#include <bits/stdc++.h>

#define var auto
#define ll long long
//#define APPLY(a, f) f(a.begin(), a.end())
#define APPLY(a, f, ...) f(a.begin(), a.end(), __VA_ARGS__)
#define FUN1(x, f) [&](auto& x){return f;}
#define FUN2(x, y, f) [&](auto& x){return f;}
using namespace std;

int main() {
    double d;
    cin >> d;
    double res = d * sqrt(2);
    for (int i = 1; i <= 10; i++){
        var sqrtx = d * d - i * i;
        if (sqrtx < 0) break;
        if (sqrtx <= 1) res = max(res, (double)i + 1);
    }
    cout << fixed << setprecision(15);
    cout << res << endl;
}


