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

Source: aizu | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
d = float(input())
ans = max(2 ** 0.5 * d, int(d) + 1)
print(ans)


n = float(input())
print(int(n) + 1 if n * 2 ** 0.5 < int(n) + 1 else n * 2 ** 0.5)


n = float(input())
print(n // 1 + 1 if n * 2 ** 0.5 < n // 1 + 1 else n * 2 ** 0.5)


n = float(input())
print(int(n) + 1 if n * 2 ** 0.5 < n // 1 + 1 else n * 2 ** 0.5)


d = float(input())
print(max(int(d) + 1, d * 2 ** 0.5))


d = float(input())
ans = d * pow(2, 0.5)
for i in range(1, 11):
	if i <= d <= pow(1 + i ** 2, 0.5):
		ans = max(ans, i + 1)
print('{:.020f}'.format(ans))


import math
n = float(input())
print(int(n) + 1 if n * math.sqrt(2) < int(n) + 1 else n * math.sqrt(2))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 998244353
dd = [(0, -1), (1, 0), (0, 1), (-1, 0)]
ddn = [(0, -1), (1, -1), (1, 0), (1, 1), (0, 1), (-1, -1), (-1, 0), (-1, 1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	n = F()
	nn = n ** 2
	r = n * 2 ** 0.5
	for i in range(int(n) + 1):
		kk = nn - i ** 2
		if kk < 0:
			break
		k = kk ** 0.5
		tr = i + k
		if k < 1:
			tr += 1 - k
		if r < tr:
			r = tr
	return r
print(main())