#include <bits/stdc++.h>
using namespace std;
long long facs[20], pwrs[20];
set<string> s;
void pre() {
  facs[0] = 1;
  pwrs[0] = 1;
  for (long long i = 1; i <= 19; i++) {
    facs[i] = facs[i - 1] * i;
    pwrs[i] = pwrs[i - 1] * 2;
  }
}
long long get_answer(long long *arr) {
  long long n = 0;
  for (long long i = 0; i < 10; i++) {
    n += arr[i];
  }
  long long ans = facs[n];
  for (long long i = 0; i < 10; i++) ans /= facs[arr[i]];
  long long ans1 = 0;
  if (arr[0] > 0) {
    arr[0]--;
    ans1 = facs[n - 1];
    for (long long i = 0; i < 10; i++) ans1 /= facs[arr[i]];
  }
  ans -= ans1;
  return ans;
}
long long mask = 0;
long long get_answer1(long long n, long long k) {
  long long t = 0;
  while (n > 0) {
    if (n >= k) {
      t += k;
      n -= k;
    } else {
      t += n;
      break;
    }
    long long e = n / 10;
    n -= e;
  }
  return t;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long low = 1, high = 2e18;
  while (high > low + 1) {
    long long mid = (low + high) >> 1;
    if (2 * get_answer1(n, mid) >= n)
      high = mid;
    else
      low = mid;
  }
  if (2 * get_answer1(n, low) >= n)
    cout << low;
  else
    cout << high;
}
