#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const int MX = 200005;
int N, M, k;
int arr[MX];
long long n;
bool ch(long long mid, long long nn) {
  long long v = 0;
  while (nn > 0) {
    v += min(mid, nn);
    nn -= min(mid, nn);
    long long cur = nn / 10;
    if (!cur) break;
    nn -= cur;
  }
  v += max(0LL, nn);
  return v * 2LL >= n;
}
int main() {
  cin >> n;
  long long lo = 1, hi = n, R;
  while (lo <= hi) {
    long long mid = (lo + hi) >> 1;
    if (ch(mid, n)) {
      R = mid;
      hi = mid - 1;
    } else
      lo = mid + 1;
  }
  cout << R;
}
