Problem: In Manhattan, roads run where the x or y coordinate is an integer. Both Sunuke-kun's house and Sumeke-kun's house are on the road, and the straight line distance (Euclidean distance) is just d. Find the maximum value that can be considered as the shortest distance when traveling along the road from Sunuke-kun's house to Sumek-kun's house.

Constraints

* 0 <d ≤ 10
* d is given up to exactly three decimal places

Input


d


Output

Print the answer on one line. If the absolute error or relative error is 10-9 or less, the answer is judged to be correct.

Examples

Input

1.000


Output

2.000000000000


Input

2.345


Output

3.316330803765

Solution (in CPP):

Solution:
#include <cstdio>
#include <iostream>
#include<math.h>
#include <vector>
#include <algorithm>
#define rep(i,n) for(int i = 0; i < n; ++i)
using namespace std;
 
int main(){
		double a;scanf("%lf",&a);
		int b=(int)(a*1000+0.5);
		double ret=0;
		for(int i=0;i<=b;i++){
			int c=(int)(sqrt(0.5+b*b-i*i));
	//		if(c*c+i*i==b*b){
				//printf("%d %d\n",c,i);
				if(i%1000==0&&c<1000){
					ret=max(ret,i+1000.0);
				}
				if(c%1000==0&&i<1000){
					ret=max(ret,c+1000.0);
				}
				ret=max(ret,(double)i+c);
			}
		
		if(sqrt((int)(a+(1e-9)))<a){
			ret=max(ret,1000.0+(int)(a+(1e-9))*1000);
		}
		ret=max(ret,sqrt(2)*b);
		printf("%.12f\n",ret/1000);
}