#include <iostream>
#include <cmath>
#include <cstdio>
#define REP(i, a, n) for(int i = ((int) a); i < ((int) n); i++)
using namespace std;

double d;

int main(void) {
  cin >> d;

  double ans = d;
  int s = 1;
  while(s * s <= d * d) {
    double t = sqrt(d * d - s * s);
    ans = max(ans, s + max(1.0, t));
    s++;
  }
  ans = max(ans, d * sqrt(2));

  printf("%.15lf\n", ans);

  return 0;
}