#include <bits/stdc++.h>

using namespace std;

int main() {
    double d;
    cin >> d;
    int d1 = d*1000;
    double ans = sqrt(2)*d;
    ans = max<double>(ans, (int)(d)+1);
    printf("%.10lf\n", ans);
    return 0;
}