#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <math.h>

using namespace std;
typedef long double ld;

const ld EPS = 10e-14;

void solve();


int main( void ) {

	solve();

	return 0;
}

void solve() {

	ld d, e, f = 0.0;
	cin >> d;

	f = floor( d );
	if( d*d - f*f + EPS < 1.0 ) {
		e = f + 1.0;
	}
	d = sqrt(2.0)*d;

	cout << fixed << setprecision(14) << max(d,e) << endl;

	return;

}