#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int power(long long int x, long long int n) {
  if (n == 0) return 1;
  if (n % 2) return x * power(x * x, (n - 1) / 2);
  return power(x * x, n / 2);
}
long long int check(long long int n, long long int k) {
  long long int sum = 0, x, N = n;
  while (n > 0) {
    sum += min(n, k);
    x = max(0LL, n - k);
    n = x - (x / 10);
  }
  if (2 * sum >= N)
    return true;
  else
    return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int l = 0, r = n;
  while (l < r - 1) {
    long long int mid = (l + r) / 2;
    if (check(n, mid))
      r = mid;
    else
      l = mid;
  }
  cout << r;
  return 0;
}
