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 <bits/stdc++.h>
using namespace std;
 
static const double EPS = 1e-5;
 
int main() {
    double d;
    cin >> d;
     
    double ans = 0;
     
    if (d < 1.0) ans = sqrt(2.0) * d;
     
    for (int r = 1; r <= 10; ++r) {
        double lb = (double)r, ub = sqrt(1.0 + (double)(r * r));
         
        if (lb < d + EPS && d < ub + EPS) {
            ans = max(sqrt(2.0) * d, (double)(r + 1));
            break;
        } else if (ub < d && d < (double)(r + 1) + EPS) {
            ans = sqrt(2.0) * d;
            break;
        }
    }
     
    printf("%.12f\n", ans);
}