#include<bits/stdc++.h>
using namespace std;

int main(){
	double d;
	cin>>d;
	  cout << fixed<< setprecision(10);
	if(d<1 ){
		cout<<d*sqrt(2)<<endl;
	}
	else cout<<max( (double)((int)(d+1) ),d*sqrt(2) ) <<endl;
	return 0;
}

