#include <bits/stdc++.h>
using namespace std;
long long min(long long a, long long b) {
  if (a < b) return a;
  return b;
}
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
long long n, ans, start, mid, c1, c2, x;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  ans = n;
  start = 1;
  long long end = n;
  while (start <= end) {
    mid = (end - start) / 2 + start;
    x = n;
    c1 = 0;
    c2 = 0;
    while (x > 0 && c2 <= n / 2 && c1 < n / 2) {
      c1 += min(mid, x);
      x -= min(mid, x);
      c2 += x / 10;
      x -= x / 10;
    }
    if (c1 < n / 2)
      start = mid + 1;
    else {
      ans = mid;
      end = mid - 1;
    }
  }
  cout << ans << endl;
  return 0;
}
