#include <bits/stdtr1c++.h>
using namespace std;

typedef long double ld;

const ld EPS = 1e-6;

ld f(ld x) {
  int t = 1;
  while (1.0L/t > x)
    t++;
  ld c = x, nc = 0, co = 1.0L-x;
  for (int i = 2; i <= t; i++) {
    nc += co;
    c += co*min(1.0L,i*x);
    co *= 1.0L-i*x;
  }
  return c/(c+nc);
}

int main() {
  ios::sync_with_stdio(0);
  srand(time(NULL));
  ld p;
  while (cin >> p) {
    ld lo = 0, hi = 1;
    while (hi-lo > EPS) {
      ld mid = lo+(hi-lo)/2;
      if (f(mid) < p)
        lo = mid;
      else
        hi = mid;
    }
    cout << fixed << setprecision(3) << lo << "\n";
  }
  return 0;
}