#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, l, r, mid, x, tmp, cnt, sum, ans = 1e18;
  cin >> n;
  l = 0, r = n;
  while (l <= r) {
    sum = 0;
    mid = (l + r) >> 1;
    if (mid == 0) {
      l += 1;
      continue;
    }
    tmp = n;
    while (1) {
      if (tmp >= mid) {
        tmp -= mid;
        sum += mid;
      } else
        sum += tmp, tmp = 0;
      tmp -= tmp / 10;
      x = n % 2 ? (n / 2) + 1 : n / 2;
      if (sum >= x) break;
      if (tmp == 0) {
        sum = -1;
        break;
      }
    }
    if (sum != -1) {
      r = mid - 1;
      ans = min(ans, mid);
    } else
      l = mid + 1;
  }
  cout << ans << endl;
  return 0;
}
