#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <cmath>

using namespace std;

int main(void){
    double a;
    cin >> a;
    
    double b = sqrt(a*a - (int)a/1*(int)a/1);
    
    double x = 0;
    if (b < 1) x = (int)a/1 + 1;
    
    double z = a/sqrt(2) * 2;
    
    double ans;
    b < 1 ? ans = max(x,z) : ans = z;
    printf("%.12lf\n",ans);
}