#include <bits/stdc++.h>
inline int read() {
  char c = getchar();
  int x = 0, f = 1;
  while (!isdigit(c)) {
    if (f == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
using namespace std;
long long n;
int ck(long long k) {
  long long tn = n, x, res = 0;
  while (tn) {
    if (tn < k)
      res += tn, tn = 0;
    else
      tn -= k, res += k;
    if (tn >= 10) {
      x = tn / 10;
      tn -= x;
    }
  }
  return (res * 2LL >= n);
}
int A[10000];
int main() {
  scanf("%I64d", &n);
  long long l = 1, r = n, ans, mid;
  while (l <= r) {
    mid = (l + r) / 2LL;
    if (ck(mid))
      r = mid - 1, ans = mid;
    else
      l = mid + 1;
  }
  printf("%I64d\n", ans);
  return 0;
}
