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

double getp(double x) {
  if (x > 0.5) {
    return  1.0 / (2.0 - x);
  }
  double exp = 0.0;
  double p = 1.0;
  for (int i = 0; i < 1 / x; i++) {
    p *= max(0.0, (1 - x * i));
    exp += p * min(1.0, (i + 1) * x) * (i + 1);
  }
  return 1.0 / exp;
}

int main() {
  double input;
  while (cin >> input) {

    double lo = 0;
    double hi = 1.0;
    double mid = (lo + hi) / 2.0;

    while (abs(hi - lo) > 1e-4) {
      mid = (lo + hi) / 2.0;
      if (getp(mid) < input) {
        lo = mid;
      } else {
        hi = mid;
      }
    }
    cout << fixed << setprecision(3) << lo << endl;
  }
  return 0;
}