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 <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef complex<double> xy_t;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-11;

int main() {
    double d;
    cin >> d;
    double pos[11];
    for (int i = 0; i <= 10; i++) {
        if (i > d) {
            pos[i] = -1;
            continue;
        }
        pos[i] = sqrt(d * d - i * i);
    }
    double dis[11];
    for (int i = 0; i <= 10; i++) {
        if (pos[i] == -1) {
            dis[i] = -1;
            continue;
        }
        if (i > 0 && pos[i] < 1) {
            dis[i] = i * 1.0 + 1;
        } else {
            dis[i] = i * 1.0 + pos[i];
        }
    }
    double ans = 0;
    for (int i = 0; i <= 10; i++) {
        if (ans < dis[i]) {
            ans = dis[i];
        }
    }
    ans = max(ans, d * sqrt(2));
    cout << setprecision(12);
    cout << ans << endl;
}