#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define int long long
using namespace std;
typedef pair<int, int> P;

signed main(){
    double d;
    cin >> d;
    double ans = max(sqrt(2) * d, (double)(int)(d + 1));    
    printf("%.10f\n", ans);
}
