#include <bits/stdc++.h>
using namespace std;
int posi(long long int x, long long int n) {
  long long int i = n, y;
  long long int sum = 0;
  while (n > 0) {
    if (n < x) {
      sum = sum + n;
      n = n - n;
    } else {
      sum = sum + x;
      n = n - x;
    }
    y = n / 10;
    n = n - y;
  }
  return (2 * sum >= i);
}
int main() {
  long long int n;
  cin >> n;
  long long int start = 0, x, mid;
  long long int end = n;
  long long int ans = n;
  while (end - start > 1) {
    mid = ((end + start) / 2);
    x = posi(mid, n);
    if (x == 1) {
      end = mid;
      ans = min(ans, mid);
    } else {
      start = mid;
    }
  }
  cout << ans << "\n";
}
