#include <bits/stdc++.h>
using namespace std;
long long int solve(long long int n, long long int k) {
  if (k >= n) return n;
  n -= k;
  long long int p = n / 10;
  n -= p;
  return k + solve(n, k);
}
int main() {
  long long int n;
  cin >> n;
  long long int ans = -1;
  long long int l = 1;
  long long int r = n;
  while (l <= r) {
    long long int mid = (l + r) / 2;
    if ((solve(n, mid) * 2) >= n) {
      ans = mid;
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  cout << ans << endl;
  return 0;
}
