#include <bits/stdc++.h>
using namespace std;
long long n;
long long expo(long long base, long long exponent, long long mod) {
  long long ans = 1;
  while (exponent != 0) {
    if ((exponent & 1) == 1) {
      ans = ans * base;
      ans = ans % mod;
    }
    base = base * base;
    base %= mod;
    exponent >>= 1;
  }
  return ans % mod;
}
long long check(long long x) {
  long long a = 0, b = 0, cnt = n, k = x;
  a += min(cnt, k);
  cnt -= min(k, cnt);
  while (cnt >= 10) {
    cnt -= cnt / 10;
    a += min(cnt, k);
    cnt -= min(k, cnt);
  }
  long long tot = a + cnt;
  if (2LL * tot >= n) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long i, j;
  cin >> n;
  long long lo = 1, hi = n, mid;
  while (lo < hi) {
    mid = (lo + hi) / 2LL;
    if (check(mid))
      hi = mid;
    else
      lo = mid + 1;
  }
  cout << hi;
  return 0;
}
