#include <bits/stdc++.h>
using namespace std;
long long n;
long long Fun(long long x) {
  long long sum = 0;
  long long temp = n;
  int times = 1;
  while (temp >= 10) {
    if (times & 1) {
      temp -= x;
      sum += x;
    } else
      temp -= (temp / 10);
    times++;
  }
  sum += temp;
  return sum;
}
int main() {
  scanf("%I64d", &n);
  long long l = 1, r = n;
  while (l < r) {
    long long mid = (l + r) / 2;
    if (Fun(mid) >= (n + 1) / 2)
      r = mid;
    else
      l = mid + 1;
  }
  printf("%I64d\n", l);
  return 0;
}
