#include <bits/stdc++.h>

using namespace std;

int main()
{
	double d;
	scanf("%lf", &d);

	double ans = d * sqrt(2);

	for (int x = -10; x <= 10; x++){
		if (d * d - x * x >= 0){
			double y = sqrt(max(0.0, d * d - x * x));
			ans = max(ans, fabs(x) + (x && y <= 1.0 ? 1.0 : y));
		}
	}

	printf("%.10lf\n", ans);

	return (0);
}