#include <bits/stdc++.h>
using namespace std;
int main()
{
long long n;
cin >> n;
long long k = 1;
long long left = 1;
long long right = ceil((float)n / 2);
while (left < right) {
k = (left + right) / 2;
long long m = n;
long long days = 0;
while (m) {
if (m < k) {
break;
} else {
m -= k;
days++;
long long pet = m / 10;
m -= pet;
}
}
if (k * days + m >= ceil((float)n / 2)) {
right = k;
} else {
left = k + 1;
}
}
cout << right << endl;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiAKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKIAppbnQgbWFpbigpCnsKCWxvbmcgbG9uZyBuOwoJY2luID4+IG47CiAKCWxvbmcgbG9uZyBrID0gMTsKIAoJbG9uZyBsb25nIGxlZnQgPSAxOwoJbG9uZyBsb25nIHJpZ2h0ID0gY2VpbCgoZmxvYXQpbiAvIDIpOwogCgl3aGlsZSAobGVmdCA8IHJpZ2h0KSB7CgkJayA9IChsZWZ0ICsgcmlnaHQpIC8gMjsKIAoJCWxvbmcgbG9uZyBtID0gbjsKCQlsb25nIGxvbmcgZGF5cyA9IDA7CiAKCQl3aGlsZSAobSkgewoJCQlpZiAobSA8IGspIHsKCQkJCWJyZWFrOwoJCQl9IGVsc2UgewoJCQkJbSAtPSBrOwoJCQkJZGF5cysrOwogCgkJCQlsb25nIGxvbmcgcGV0ID0gbSAvIDEwOwoJCQkJbSAtPSBwZXQ7CgkJCX0KCQl9CiAKCQlpZiAoayAqIGRheXMgKyBtID49IGNlaWwoKGZsb2F0KW4gLyAyKSkgewoJCQlyaWdodCA9IGs7CgkJfSBlbHNlIHsKCQkJbGVmdCA9IGsgKyAxOwoJCX0KCX0KIAoJY291dCA8PCByaWdodCA8PCBlbmRsOwogCglyZXR1cm4gMDsKfQ==