#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
signed long long int gcd(signed long long int a, signed long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
signed long long int n;
signed long long int pre(signed long long int x) {
  signed long long int kk = n, counta = 0;
  int flag = 1;
  while (kk > 0) {
    if (flag) {
      if (kk - x <= 0) {
        counta += kk;
        break;
      }
      counta += x;
      kk -= x;
      flag = 0;
    } else {
      kk = kk - kk / 10;
      flag = 1;
    }
  }
  return counta;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  signed long long int start = 1, end = 1000000000000000000;
  while (end > start) {
    signed long long int mid = (start + end) >> 1;
    if (2 * pre(mid) >= n)
      end = mid;
    else
      start = mid + 1;
  }
  cout << start << "\n";
  return 0;
}
