#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int num;
  cin >> num;
  long long int l = 1, r = 1000000000000000000;
  long long int ans = r;
  while (l <= r) {
    long long int mid = (l + r) / 2;
    long long int ted = 0, tad = num;
    while (tad > 0) {
      ted += min(tad, mid);
      tad -= min(tad, mid);
      long long int lol = tad / 10;
      tad -= lol;
    }
    if ((long long int)2 * ted >= num) {
      r = mid - 1;
      ans = min(ans, mid);
    } else {
      l = mid + 1;
    }
  }
  if (ans == 1000000000000000000) {
    ans = num / 2;
    if (num % 2 != 0) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
