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 <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <functional>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define SQ(x) ((x)*(x))
#define Mod(x, mod) (((x)+(mod)%(mod))
#define MP make_pair
#define PB push_back
#define Fi first
#define Se second
#define INF (1<<29)
#define EPS 1e-10
#define MOD 1000000007

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

int a[]={1,2,3};

int main()
{
  double d;
  scanf("%lf", &d);
  double res = 0;
  res = max(res, sqrt(SQ(d)/2)*2);
  for(int i=0;i<3;i++){
    //   cout << SQ(d) << " " << SQ(a[i]) << endl;
    if(SQ(d) >= SQ(a[i]) && SQ(d) - SQ(a[i]) <= 1){
      double e;
      if(SQ(d) - SQ(a[i]) <= 0 + EPS)  e = 0;
      else e = sqrt(SQ(d)-SQ(a[i]));
      //      cout << SQ(d) - SQ(a[i]) << endl;
      res = max(res, a[i]+(1-e)+e);
      //      cout << e << endl;
      //      cout << a[i]+(1-e)+e << endl;
    }
  }
  printf("%.12lf\n", res);
  return 0;
}