#include <bits/stdc++.h>

using namespace std;

#define range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)

int main(void){
	double d;
	cin >> d;
	double ans=d;
	int df=d/1.0;
	if(df>=1) ans=max<double>(ans,df+1);
	ans=max<double>(ans,2*sqrt(d*d/2));
	cout.precision(15);
	cout << fixed << ans << endl;
	return 0;
}