#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
const int MOD = 1000000007;
const int oo = 1e9;
long long n;
long long can(long long k) {
  long long cur = 0;
  long long pet = 0;
  long long rem = n;
  while (rem > 0) {
    long long take = min(rem, k);
    cur += take;
    rem -= take;
    pet += rem / 10;
    rem -= rem / 10;
    if (2 * pet > n) return false;
  }
  return (2 * cur >= n);
}
int main() {
  cin >> n;
  long long lo = 1, hi = 1000000000000000000, best;
  while (lo <= hi) {
    long long md = (lo + hi) / 2;
    if (can(md)) {
      best = md;
      hi = md - 1;
    } else {
      lo = md + 1;
    }
  }
  cout << best << endl;
  return 0;
}
