Little Sofia is in fourth grade. Today in the geometry lesson she learned about segments and squares. On the way home, she decided to draw $n$ squares in the snow with a side length of $1$. For simplicity, we assume that Sofia lives on a plane and can draw only segments of length $1$, parallel to the coordinate axes, with vertices at integer points.

In order to draw a segment, Sofia proceeds as follows. If she wants to draw a vertical segment with the coordinates of the ends $(x, y)$ and $(x, y+1)$. Then Sofia looks if there is already a drawn segment with the coordinates of the ends $(x', y)$ and $(x', y+1)$ for some $x'$. If such a segment exists, then Sofia quickly draws a new segment, using the old one as a guideline. If there is no such segment, then Sofia has to take a ruler and measure a new segment for a long time. Same thing happens when Sofia wants to draw a horizontal segment, but only now she checks for the existence of a segment with the same coordinates $x$, $x+1$ and the differing coordinate $y$.

For example, if Sofia needs to draw one square, she will have to draw two segments using a ruler:  [Image] 

After that, she can draw the remaining two segments, using the first two as a guide:  [Image] 

If Sofia needs to draw two squares, she will have to draw three segments using a ruler:  [Image] 

After that, she can draw the remaining four segments, using the first three as a guide:  [Image] 

Sofia is in a hurry, so she wants to minimize the number of segments that she will have to draw with a ruler without a guide. Help her find this minimum number.


-----Input-----

The only line of input contains a single integer $n$ ($1 \le n \le 10^{9}$), the number of squares that Sofia wants to draw.


-----Output-----

Print single integer, the minimum number of segments that Sofia will have to draw with a ruler without a guide in order to draw $n$ squares in the manner described above.


-----Examples-----
Input
1

Output
2

Input
2

Output
3

Input
4

Output
4

Difficulty: EASY
Tags: Sorting

Mathematics

Constructive algorithms
Skill types: Sorting

Starter code:

Solutions:
from bisect import bisect_right as br
from bisect import bisect_left as bl
from collections import defaultdict
from itertools import combinations
import functools
import sys
import math
MAX = sys.maxsize
MAXN = 10 ** 6 + 10
MOD = 10 ** 9 + 7

def isprime(n):
	n = abs(int(n))
	if n < 2:
		return False
	if n == 2:
		return True
	if not n & 1:
		return False
	for x in range(3, int(n ** 0.5) + 1, 2):
		if n % x == 0:
			return False
	return True

def mhd(a, b, x, y):
	return abs(a - x) + abs(b - y)

def numIN():
	return map(int, sys.stdin.readline().strip().split())

def charIN():
	return sys.stdin.readline().strip().split()
t = [0] * 1000010

def create(a, n):
	global t
	for i in range(n, 2 * n):
		t[i] = a[i - n]
	for i in range(n - 1, 0, -1):
		t[i] = t[2 * i] + t[2 * i + 1]

def ncr(n, k):
	res = 1
	c = [0] * (k + 1)
	c[0] = 1
	for i in range(1, n + 1):
		for j in range(min(i, k), 0, -1):
			c[j] = (c[j] + c[j - 1]) % MOD
	return c[k]
a = [0]
n = int(input())
s = 0
i = 1
while s <= 10 ** 9:
	s += i
	a.append(s)
	s += i
	a.append(s)
	i += 1
x = br(a, n)
if a[x - 1] == n:
	print(x)
else:
	print(x + 1)


import math
n = int(input())
a = int(math.sqrt(n))
if a * a < n:
	a += 1
b = math.ceil(n / a)
print(a + b)


n = int(input())
k = 0
j = 1
cou = -1
i = 1
lol = 0
while k < n:
	i += 1
	cou += 1
	if cou == 2:
		j += 1
		cou = 0
	k += j
print(i)


import math
x = eval(input())
r = math.ceil(math.sqrt(x))
r1 = math.ceil(x / r)
print(r + r1)


import math
n = int(input())
if n == 1:
	print('2')
elif n == 2:
	print('3')
else:
	x = math.sqrt(n)
	y = math.floor(x)
	if x == y:
		print(y * 2)
	else:
		z = y * y + y
		if n <= z:
			print(y * 2 + 1)
		else:
			print(y * 2 + 2)


import math
n = int(input())
step = 2
x = 1
y = 1
number = 0
fl = True
if n == 1:
	print(2)
while number < n:
	if x == y and fl:
		x += 1
		step += 1
		number = x * y
		fl = False
	if x > y and fl:
		y += 1
		step += 1
		number = x * y
		fl = False
	if x < y and fl:
		x += 1
		step += 1
		number = x * y
		fl = False
	fl = True
if n != 1:
	print(step)


n = int(input())
i = 1
while i * i < n:
	i += 1
if i * i == n:
	print(i * 2)
	exit()
i -= 1
if n < i * i + i + 1:
	print(2 * i + 1)
else:
	print(2 * i + 2)


from itertools import count
from math import ceil
n = int(input())
q = next(filter(lambda q: q ** 2 > n, count(1))) - 1
print(2 * q + ceil((n - q ** 2) / q))


n = int(input())
s = 0
while s * s <= n:
	s += 1
s -= 1
if n == s * s:
	print(2 * s)
	return
d = n - s * s
from math import ceil
print(2 * s + ceil(d * 1.0 / s))


from math import ceil
n = int(input())
k = ceil(n ** 0.5)
print(ceil(n / k) + k)


n = int(input())
i = 1
ans = 1 << 30
while i * i <= n:
	ans = min(ans, i + -(-n // i))
	i += 1
print(ans)


n = int(input())
a = 0
b = 0
while a * b < n:
	if a == b:
		a += 1
	else:
		b += 1
print(a + b)


from math import sqrt, floor, ceil
a = int(input())
b = floor(sqrt(a))
c = a - b ** 2
if c == 0:
	print(2 * b)
elif a <= b ** 2 + b:
	print(2 * b + 1)
else:
	print(2 * b + 2)


n = int(input())
i = 0
while (i + 1) * (i + 1) < n:
	i += 1
if pow(i + 1, 2) == n:
	print(2 * i + 2)
elif i * (i + 1) >= n:
	print(i + (i + 1))
else:
	print(2 * i + 2)


import math
n = int(input())
p = int(math.sqrt(n))
ans = 100000000
if n == 1:
	ans = 2
	print(ans)
else:
	if p * p == n:
		ans = min(2 * p, ans)
	elif p * (p + 1) >= n:
		ans = min(p + p + 1, ans)
	else:
		ans = min(2 * (p + 1), ans)
	print(ans)


import math
n = int(input())
print(math.ceil(n ** 0.5 * 2))


from math import sqrt
n = int(input())
x = int(sqrt(n))
if sqrt(n) == x:
	print(2 * x)
else:
	s = 0
	for i in range(1, n + 1):
		if x * i >= n:
			s = x + i
			break
	print(s)


from math import sqrt
n = int(input())
l = int(sqrt(n))
if l ** 2 == n:
	print(l * 2)
elif (l + 1) * l >= n:
	print(2 * l + 1)
else:
	print(2 * (l + 1))


import math
n = int(input())
if n == 1:
	print(2)
elif n == 2:
	print(3)
elif n == 3 or n == 4:
	print(4)
else:
	sq = int(math.sqrt(n))
	if sq * sq == n:
		sq -= 1
	dif = (sq + 1) ** 2 - sq ** 2
	if n - sq * sq > dif // 2:
		print(2 * (sq + 1))
	else:
		print(2 * (sq + 1) - 1)


import math
en = int(input())
if en <= 3:
	print(en + 1)
else:
	qdd = math.sqrt(en)
	qdd_pft = math.floor(math.sqrt(en))
	pft_sq = qdd_pft ** 2
	if qdd == qdd_pft:
		print(2 * qdd_pft)
	elif en <= pft_sq + qdd_pft:
		print(2 * qdd_pft + 1)
	else:
		print(2 * (qdd_pft + 1))


import math
n = int(input())
x = int(n ** (1 / 2))
y = (x + 1) ** 2
x1 = x
x = x ** 2
z = (y - x - 1) // 2
c = 2 * (x1 + 1)
if n == x:
	c = 2 * x1
elif n <= x + z:
	c -= 1
print(c)


from math import sqrt, ceil
n = int(input())
a = ceil(sqrt(n))
b = ceil(n / a)
print(a + b)


from math import sqrt
n = int(input())
q = int(sqrt(n))
rest = n - q * q
k = rest // q
if rest % q != 0:
	k += 1
print(q * 2 + k)


import math
n = int(input())
if int(math.sqrt(n)) * int(math.sqrt(n)) == n:
	print(2 * int(math.sqrt(n)))
else:
	num = int(math.sqrt(n))
	sq = num
	num = sq * sq
	if n - num <= sq:
		print(2 * sq + 1)
	else:
		sq += 1
		print(2 * sq)


import math
n = int(input())
rows = math.floor(n ** 0.5)
cols = math.ceil(n ** 0.5)
diff1 = n - rows * rows
diff2 = cols * cols - n
if diff1 < diff2:
	ans = rows + cols
else:
	ans = cols + cols
print(ans)


n = int(input())
m = int(n ** 0.5)
print(2 * m + (m * m < n) + (m * (m + 1) < n))


import math
n = int(input())
next_root = math.ceil(math.sqrt(n))
square = next_root ** 2
if n <= next_root * (next_root - 1):
	print(next_root + next_root - 1)
else:
	print(next_root + next_root)


n = int(input())
n = 4 * n
import math
ans = math.ceil(n ** 0.5)
print(ans)


import math
n = int(input())
if n == 1:
	print(2)
elif n == 2:
	print(3)
elif n == 3:
	print(4)
else:
	s = math.floor(math.sqrt(n))
	if s * s == n:
		print(2 * s)
	elif s * (s + 1) < n:
		print(2 * (s + 1))
	else:
		print(2 * s + 1)


import math
n = int(input())
m = n + 2
for i in range(1, int(math.sqrt(n)) + 1):
	t = n // i
	if t * i == n:
		if t + i < m:
			m = i + t
	elif i + t + 1 < m:
		m = i + t + 1
print(m)


def SqBeforeN(n):
	for i in range(int(n ** 0.5) + 3):
		if i ** 2 >= n:
			return i - 1

def MinSegments(n):
	sqrt = SqBeforeN(n)
	if n == sqrt ** 2:
		return 2 * sqrt
	elif n <= sqrt ** 2 + sqrt:
		return 2 * sqrt + 1
	else:
		return 2 * (sqrt + 1)

def main():
	n = int(input())
	print(MinSegments(n))
main()


import math
n = int(input())
s1 = int(math.sqrt(n))
s2 = n // s1
ans = s1 + s2
if s1 * s2 < n:
	diff = n - s1 * s2
	m = max(s1, s2)
	ans += math.ceil(diff / m)
print(ans)


import math
n = int(input())
print(1 + math.floor(math.sqrt(4 * n - 3)))


import sys
import math
n = int(input())
if n == 1:
	print(2)
else:
	for i in range(1, 318000):
		if i * i == n:
			print(2 * i)
			break
		if i * (i + 1) >= n and i * i < n:
			print(i + i + 1)
			break
		if i * i >= n and i * (i - 1) < n:
			print(i + i)
			break


n = int(input())
a = []
ans = 0
i = 1
cnt = 0
a.append(0)
while ans <= n:
	ans += i
	a.append(ans)
	ans += i
	a.append(ans)
	i += 1
ans = 0
for i in a:
	if n <= i:
		ans += 1
		break
	ans += 1
print(ans)


n = int(input())
k = int(n ** 0.5)
if n == 1:
	print(2)
elif n == 2:
	print(3)
elif k * k == n:
	print(k + k)
elif (k + 1) * k >= n > k * k:
	print(k + k + 1)
elif (k + 1) * (k + 1) > n > k * (k + 1):
	print(k + k + 2)


n = int(input())
t = int(n ** 0.5)
if t ** 2 >= n:
	print(t * 2)
elif t * (t + 1) >= n:
	print(t * 2 + 1)
elif t * (t + 2) >= n:
	print(t * 2 + 2)


import math
n = int(input())
x = math.ceil(n ** 0.5)
y = math.ceil(n / x)
print(x + y)


import math
n = int(input())
ans = s = int(math.sqrt(n))
while s * ans < n:
	ans += 1
print(s + ans)


n = int(input())
c = 1
while c ** 2 < n:
	c += 1
s = c * 2
s1 = c ** 2 - n
s1 = s1 // c
s = s - s1
print(s)


s = int(input())

def getseq(s):
	seq = [0]
	step = 1
	while seq[-1] < s:
		seq.append(seq[-1] + step)
		seq.append(seq[-1] + step)
		step += 1
	return seq

def final(s):
	l = getseq(s)
	if s == 0:
		return 0
	elif s > l[-2]:
		return len(l)
	else:
		return len(l) - 1
output = final(s)
print(output)


n = int(input())
sol = 0
for i in range(1, 1000000):
	sol += 1
	n -= i
	if n > 0:
		n -= i
		sol += 1
		if n <= 0:
			break
	else:
		break
print(sol + 1)


import sys
import math
from math import ceil, sqrt
n = int(input())
res = n + 100000
vc = int(sqrt(n)) + 100
for x in range(1, vc):
	y = int(n / x)
	if x * y < n:
		y += 1
	res = min(res, x + y)
print(res)


import math

def main():
	i = int(input())
	modul = round(math.sqrt(i))
	if modul ** 2 == i:
		print(modul * 2)
	else:
		a = math.ceil(math.sqrt(i))
		print(a + modul)
main()


def segments(n):
	ans = n ** 0.5
	if ans == int(ans):
		return int(ans) * 2
	elif int(ans + 1) * int(ans) >= n:
		return int(ans + 1) + int(ans)
	else:
		return int(ans + 1) + int(ans + 1)
print(segments(int(input())))


from math import sqrt
from math import ceil
n = int(input())
c = ceil(sqrt(n))
r = ceil(n / c)
print(r + c)


import math
n = int(input())
side = math.ceil(math.sqrt(n))
if n <= side * (side - 1):
	print(side + side - 1)
else:
	print(side + side)


import math

def binarySearch(l, r, x):
	while l <= r:
		mid = l + (r - l) // 2
		if mid == x:
			return mid
		elif mid < x:
			l = mid + 1
		else:
			r = mid - 1
n = int(input())
high = int(1000000000.0 * 1000000000.0)
low = 1
m = binarySearch(low, high, math.ceil(math.sqrt(n)))
if m * m == n or m * m - n < m:
	print(m + m)
else:
	print(m + (m - 1))


n = int(input())
kk = int(n ** (1 / 2))
if kk ** 2 == n:
	print(2 * kk)
elif kk >= n - kk * kk:
	print(2 * kk + 1)
else:
	print(2 * kk + 2)


s = int(input())
a = int(s ** (1 / 2))
if a * a >= s:
	print(a * 2)
elif a * (a + 1) >= s:
	print(a * 2 + 1)
else:
	print(a * 2 + 2)


import math as mt
import sys
import bisect
input = sys.stdin.readline
t = 1
for _ in range(t):
	n = int(input())
	s1 = int(mt.sqrt(n))
	s2 = s1 + 1
	if s1 * s1 >= n:
		print(2 * s1)
	elif s1 * s2 >= n:
		print(s1 + s2)
	else:
		print(2 * s2)


print([int(2 * n ** 0.5) + int(int(n ** 0.5) != n ** 0.5) for n in [int(input())]][0])


n = int(input())
p = n ** 0.5
p1 = int(p)
if p > p1:
	p1 += 1
if p1 ** 2 - (p1 - 1) <= n:
	print(p1 * 2)
else:
	print(p1 * 2 - 1)


from math import sqrt
n = int(input())
sq = int(sqrt(n))
s = sq * sq
if n == s:
	print(2 * sq)
elif n <= s + sq:
	print(2 * sq + 1)
else:
	print(2 * sq + 2)


import math
print(math.ceil(math.sqrt(int(input())) * 2))


n = int(input())
k = int(n ** 0.5)
if k ** 2 == n:
	print(2 * k)
elif n <= k ** 2 + k:
	print(2 * k + 1)
else:
	print(2 * k + 2)


n = int(input())
a = n ** 0.5
if a - int(a) < 0.5 and a - int(a) != 0:
	print(int(2 * int(a) + 1))
else:
	print(int(2 * round(a)))


n = int(input())
a = int(n ** 0.5)
print(a + 0 - -n // a)


import math
n = int(input())
x = n ** 0.5
a = math.floor(x)
b = math.ceil(x)
if a * a == n:
	print(2 * a)
elif a * (a + 1) >= n:
	print(2 * a + 1)
else:
	print(2 * b)


n = int(input())
if n == 1:
	print(2)
elif n == 2:
	print(3)
else:
	i = 1
	while i * i <= n:
		i += 1
	i -= 1
	if n == i * i:
		print(2 * i)
	elif n <= i * i + i:
		print(2 * i + 1)
	else:
		print(2 * i + 2)


import math
n = int(input())
if n == 1:
	print('2')
elif n == 2:
	print('3')
elif n == 3 or n == 4:
	print('4')
else:
	a = math.sqrt(n)
	b = int(math.floor(a))
	if a - b == 0:
		print(int(a + a))
	else:
		s = b + 1
		k = n // s
		if n % s == 0:
			print(s + k)
		else:
			s = s + k + 1
			print(s)


import math as m
n = int(input())
if n == 1:
	print('2')
else:
	print(str(m.ceil(m.sqrt(n * 4))))


n = int(input())
N = 1
l = 2
if n == 1:
	print(l)
else:
	i = 1
	flag = True
	while N < n:
		l += 1
		N += i
		if flag:
			i += 1
			flag = False
			continue
		flag = True
	print(l)


import math
n = int(input())
rt = int(math.sqrt(n))
sq = rt ** 2
if n == sq:
	print(2 * rt)
elif n <= sq + rt:
	print(2 * rt + 1)
else:
	print(2 * rt + 2)


from math import sqrt, ceil

def squares(n):
	m = ceil(sqrt(1.0 * n))
	k = ceil(n * 1.0 / m)
	return m + k
print(squares(int(input())))


from math import sqrt

def read(type=1):
	if type:
		file = open('input.dat', 'r')
		n = int(file.readline())
		file.close()
	else:
		n = int(input().strip())
	return n

def solve():
	max = int(sqrt(n)) + 1
	sol = 99999999999
	for i in range(1, max):
		j = n // i
		if i * j < n:
			j += 1
		if i + j < sol:
			sol = i + j
	return sol
n = read(0)
sol = solve()
print(sol)


n = int(input())
t = 0
while 1:
	t += 1
	if t // 2 * (t - t // 2) >= n:
		print(t)
		break


import math
n = int(input())
a = int(n ** 0.5)
b = math.ceil(float(n) / a)
print(a + b)


def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())
n = ii()
for i in range(1, n + 1):
	if i * i > n:
		break
i -= 1
ans = 2 * i
if n - i * i == 0:
	pass
elif n - i * i <= i:
	ans += 1
else:
	ans += 2
print(ans)


s = 0
f = 0
g = []
while s <= 1000000000:
	s = s + 2 * f
	g.append(s)
	s = s + 2 * f + 1
	g.append(s)
	s = s + 2 * f + 1
	g.append(s)
	s = s + 2 * f + 1 + 1
	g.append(s)
	f = f + 1
fl = 0
a = 0
f = int(input())
b = len(g) - 1
c = 0
while fl == 0:
	c = (b + a) // 2
	if f == g[c]:
		fl = 1
		break
	elif f < g[c]:
		b = c
	else:
		a = c
	if abs(a - b) < 50:
		break
i = 0
if fl == 1:
	print(c + 1)
else:
	for i in range(a, b + 1):
		if g[i] >= f:
			break
	print(i + 1)


print(1 + int((4 * int(input()) - 3) ** 0.5))


n = int(input())
sqrt = int(n ** (1 / 2))
x2 = sqrt * sqrt
r = None
if n - x2 == 0:
	r = 2 * sqrt
elif n - x2 > sqrt:
	r = 2 * sqrt + 2
else:
	r = 2 * sqrt + 1
print(r)


import math
n = int(input())
x = int(math.floor(math.sqrt(n)))
if x * x == n:
	x = 2 * x
elif x * x + x >= n:
	x = 2 * x + 1
else:
	x = 2 * x + 2
print(x)


import math
n = int(input())
sc = math.ceil(n ** 0.5)
if sc * (sc - 1) < n:
	ans = 2 * sc
else:
	ans = 2 * sc - 1
print(ans)


n = int(input())
w = int(n ** 0.5)
q = int(n ** 0.5)
while q * w < n:
	if q < w:
		q += 1
	else:
		w += 1
print(q + w)


n = int(input())
z = int(n ** 0.5)
if n % z == 0:
	print(int(z + n / z))
else:
	print(int(z + n / z + 1))


import sys
n = int(sys.stdin.readline())
i = 1
while i * i < n:
	i = i + 1
if i * (i - 1) >= n:
	print(2 * i - 1)
else:
	print(2 * i)


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


import math
n = int(input())
l1 = []
l2 = []
for i in range(1, int(math.sqrt(n) + 1)):
	if n % i == 0:
		if n // i == i:
			l1.append(i)
		else:
			l1.append(i)
			l2.append(n // i)
l3 = l1 + l2[::-1]
s = float('inf')
for i in l3:
	if i + n // i < s:
		s = i + n // i
w = math.ceil(math.sqrt(n))
w1 = w - 1 + w
w2 = w * 2
if (w - 1) * w >= n:
	print(min(s, w1))
else:
	print(min(s, w2))


import sys
import math, bisect
sys.setrecursionlimit(10 ** 6)
from itertools import groupby, accumulate
from heapq import heapify, heappop, heappush
from collections import deque, Counter, defaultdict

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

def neo():
	return map(int, sys.stdin.readline().split())

def Neo():
	return list(map(int, sys.stdin.readline().split()))
n = I()
t = int(n ** 0.5)
k = math.ceil(n / t)
print(t + k)


from math import ceil, sqrt

def go():
	n = int(input())
	return ceil(2 * sqrt(n))
print(go())


a = int(input())
x = 1
y = 1
k = 1
while True:
	if x * y >= a:
		print(x + y)
		break
	elif k == 1:
		x = x + 1
		k = k + 1
	elif k == 2:
		y = y + 1
		k = 1


from math import ceil
n = int(input())
a = ceil(n ** 0.5)
print(a + ceil(n / a))


from math import floor, ceil, sqrt

def calc(n):
	if floor(sqrt(n)) ** 2 == n:
		return int(2 * sqrt(n))
	else:
		return int(2 * floor(sqrt(n)) + 1)

def max_num_of_squires(n):
	return floor(n / 2) * ceil(n / 2)

def search(f, t, v):
	if f + 1 == t:
		return t
	mid = floor((f + t) / 2)
	if v <= max_num_of_squires(mid):
		return search(f, mid, v)
	else:
		return search(mid, t, v)
num = int(input())
print(int(search(0, ceil(sqrt(num)) * 2, num)))


import sys
import math
data = sys.stdin.read().splitlines()
n = int(data[0])
m = int(math.sqrt(n))
if m * m == n:
	print(m + m)
elif m * (m + 1) >= n:
	print(m + m + 1)
else:
	print(m + m + 2)


import math
n = int(input())
root_n = math.sqrt(n)
iroot_n = int(root_n)
n1 = iroot_n ** 2
if n1 == n:
	print(2 * iroot_n)
elif n >= n1 + 1 and n <= n1 + iroot_n:
	print(2 * iroot_n + 1)
else:
	print(2 * (iroot_n + 1))


n = int(input())
(w, h) = (0, 0)
width = True
while w * h < n:
	if width:
		w += 1
	else:
		h += 1
	width = not width
print(w + h)


import math
num = int(input())
temp = int(math.sqrt(num))
if num > pow(temp, 2) + temp:
	print(int(2 * temp + 2))
elif num == pow(temp, 2):
	print(int(2 * temp))
else:
	print(int(2 * temp + 1))


n = int(input())
for i in range(n + 1):
	if i ** 2 >= n:
		k = (i ** 2 + (i - 1) ** 2) / 2
		if n >= k:
			print(2 * i)
		else:
			print(2 * i - 1)
		break


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


import sys
from math import sqrt

def rounder(n):
	if n - int(n) >= 0.5:
		return int(n) + 1
	return int(n)

def main():
	n = int(input())
	q = rounder(sqrt(n))
	if q * q - n >= 0:
		return 2 * q
	return 2 * q + 1
print(main())


import math
n = int(input())
ans = math.ceil(math.sqrt(n))
x = (n + ans - 1) // ans
print(ans + x)


import math
n = int(input())
if int(n ** 0.5) == n ** 0.5:
	exit(print(2 * int(n ** 0.5)))
a = int(n ** 0.5) + 1
print(a + math.ceil(n / a))


def getS(n):
	return int(n ** (1 / 2))
squares = int(input())
ans = 0
side = getS(squares)
ans += side * 2
remains = squares - side ** 2
if remains % side == 0:
	ans += remains // side
else:
	ans += remains // side + 1
print(ans)


list_int_input = lambda inp: list(map(int, inp.split()))
int_input = lambda inp: int(inp)
string_to_list_input = lambda inp: list(inp)
n = int(input())
k = 1
while k * (k + 1) < n:
	k += 1
k -= 1
value = n - k * (k + 1)
ans = (k + 1) * 2
k += 1
if value > k:
	ans += 1
print(ans)


from math import sqrt
n = int(input())
print(int(sqrt(4 * n - 3)) + 1)


import math
n = int(input())
res = math.ceil(n ** 0.5)
if res * (res - 1) >= n:
	print(2 * res - 1)
else:
	print(2 * res)


import math
number = int(input())
root = math.sqrt(number)
floor = math.floor(root)
f = int(math.pow(floor, 2)) + floor
if root - floor == 0:
	print(floor * 2)
elif number <= f:
	print(floor * 2 + 1)
else:
	print(floor * 2 + 2)


n = int(input())
x = int(n ** 0.5)
print(x + (n - 1) // x + 1)


n = int(input())
a = 1
for i in range(n):
	if a * a >= n:
		print(2 * a)
		break
	elif a * (a + 1) >= n:
		print(2 * a + 1)
		break
	else:
		a += 1


t = int(input())
a = 1
b = 1
w = 0
i = 0
while w < t:
	w = a * b
	if w < t:
		if i % 2 == 0:
			a += 1
		else:
			b += 1
		i += 1
print(a + b)


n = int(input())
sqn = int(n ** 0.5 + 0.5)
ans = n + 1
for i in range(1, sqn + 1):
	ans = min(ans, i + (n - 1) // i + 1)
print(ans)


from math import sqrt, ceil
n = int(input())
l = int(sqrt(n)) ** 2
r = int(sqrt(n)) * 2
if l == n:
	print(r)
	exit()
if l + int(sqrt(n)) >= n:
	r += 1
else:
	r += 2
print(r)


n = int(input())
a = 1
b = 1
while n > a * b:
	if a > b:
		b += 1
	if n <= a * b:
		break
	a += 1
print(a + b)


from sys import stdin, stdout
from math import *
from heapq import *
from collections import *

def main():
	n = int(stdin.readline())
	maxab = trunc(sqrt(n) + 2)
	res = (n + 1) ** 2
	for a in range(max(1, maxab - 3), maxab + 1):
		for b in range(max(1, maxab - 3), maxab + 1):
			if a * b >= n:
				res = min(res, a + b)
	stdout.write(str(res))
	return 0
main()


n = int(input())
if n <= 3:
	print(n + 1)
else:
	a = n ** 0.5
	d = a - int(a)
	if d >= 0.5:
		a = int(a) + 1
		print(2 * a)
	elif d > 0 and d < 0.5:
		a = int(a)
		print(2 * a + 1)
	else:
		a = int(a)
		print(2 * a)


import math

def square_segment(n):
	print(math.ceil(n ** 0.5 * 2))
n = int(input())
square_segment(n)


n = int(input())
a = [0] + [i ** 2 for i in range(1, int(n ** 0.5) + 1)]
ans = []
if n in a:
	print(int(n ** 0.5) * 2)
else:
	i = a[-1]
	x = 1
	while i < n:
		for j in range(int(a[-1] ** 0.5)):
			ans.append(int(a[-1] ** 0.5) * 2 + x)
		i += int(a[-1] ** 0.5)
		x += 1
	print(ans[-1])


from math import sqrt
n = int(input())
m = round(sqrt(n) + 0.4)
print(m * 2 - 1 if n <= m ** 2 - m else m * 2 if n <= m ** 2 else m * 2 + 1)


import math
n = int(input())
a = int(math.sqrt(n))
if a ** 2 == n:
	print(2 * a)
else:
	for i in range(1, 100001):
		if i ** 2 > n:
			print(2 * (i - 1) + (n - (i - 1) ** 2 - 1) // (i - 1) + 1)
			break


from sys import stdin
import math
n = int(stdin.readline())
w = int(math.ceil(math.sqrt(n)))
if w * (w - 1) >= n:
	print(2 * w - 1)
else:
	print(2 * w)


n = int(input())
d = int(n ** 0.5) ** 2
if n - d == 0:
	print(int(n ** 0.5) * 2)
elif n == 1:
	print(2)
elif n == 2:
	print(3)
elif n == 3:
	print(4)
else:
	x = 2 * int(n ** 0.5)
	if n <= int(n ** 0.5) ** 2 + int(n ** 0.5):
		print(x + 1)
	else:
		print(x + 2)


n = int(input())
(o, r, i) = (1, 1, 1)
while n > i:
	i += r
	r += o & 1
	o += 1
print(o + 1)


def B():
	n = int(input())
	for i in range(1, n + 1):
		if i ** 2 >= n:
			print(2 * i)
			return
		if i * (i + 1) >= n:
			print(2 * i + 1)
			return
B()


a = int(input())
if a < 4:
	print(a + 1)
elif a == 4:
	print(a)
else:
	s = 4
	t = 4
	for k in range(2, 1000000000):
		if k == 2:
			if t < a <= t + 2:
				print(s + 1)
				break
			else:
				t += 2
				s += 1
		elif t < a <= t + k * 2:
			if t < a <= t + k:
				print(s + 1)
				break
			else:
				print(s + 2)
				break
		else:
			t += k * 2
			s += 2


import math
n = int(input())
nsquare = int(math.sqrt(n))
if n == nsquare * nsquare:
	print(2 * nsquare)
elif n - nsquare * nsquare <= nsquare:
	print(2 * nsquare + 1)
else:
	print(2 * nsquare + 2)


n = int(input())
import math
k = int(math.floor(n ** 0.5))
t = n - k ** 2
res = 2 * k + t // k + (1 if t % k > 0 else 0)
print(res)


import math
n = int(input())
a = int(math.sqrt(n))
if n == 1:
	print(2)
elif a * a >= n:
	print(a + a)
elif a * (a + 1) >= n:
	print(a + a + 1)
elif (a + 1) * (a + 1) >= n:
	print(a + a + 2)


from math import ceil
from math import sqrt
n = int(input())

def is_square(apositiveint):
	if apositiveint == 1:
		return True
	x = apositiveint // 2
	seen = set([x])
	while x * x != apositiveint:
		x = (x + apositiveint // x) // 2
		if x in seen:
			return False
		seen.add(x)
	return True

def sides_drawn(n):
	if is_square(n):
		return int(2 * sqrt(n))
	else:
		return ceil(sqrt(n)) + round(sqrt(n))
print(sides_drawn(n))


n = int(input())
s = 0
k = 0
while pow(s, 2) < n:
	s += 1
if s * (s - 1) >= n:
	print(2 * s - 1)
else:
	print(2 * s)


import sys
from math import *
readints = lambda : map(int, input().strip('\n').split())
n = int(input())
s = int(sqrt(n))
ans = s + s
n -= s * s
ans += ceil(n / s)
print(ans)


def sq(x):
	s = int(x ** 0.5)
	for i in range(1, -2, -1):
		ts = s + i
		if ts ** 2 <= x:
			return ts
n = int(input())
s = sq(n)
if s ** 2 == n:
	print(s * 2)
elif (s + 1) * s >= n:
	print(s * 2 + 1)
else:
	print(s * 2 + 2)


n = int(input())
(i, j) = (0, 0)
while i * j < n:
	if i == j:
		i += 1
	else:
		j += 1
print(i + j)


import math
n = int(input())
a = int(math.sqrt(n))
if a * a == n:
	print(a * 2)
elif n == 2:
	print(3)
elif n == 3:
	print(4)
else:
	if (n - a * a) % a == 0:
		b = int((n - a * a) / a)
	else:
		b = int((n - a * a) / a) + 1
	print(a * 2 + b)


from math import ceil
print(ceil(2 * int(input()) ** 0.5))


import math
n = int(input())
s = int(math.sqrt(n))
print(2 * s + math.ceil((n - s * s) / s))


import math
import os
import random
import re
import sys
n = int(input())
p = 0
t = n ** 0.5
k = math.floor(t)
l = math.ceil(t)
a = k ** 2
b = l ** 2
d = b - a
c = d // 2
e = a + k
if e >= n and d != 0:
	p = l * 2 - 1
else:
	p = l * 2
print(p)


n = int(input())
i = int(n ** 0.5)
if i ** 2 == n:
	print(2 * i)
elif (i + 1) * i >= n:
	print(2 * i + 1)
else:
	print(2 * i + 2)


from math import floor, sqrt
t = int(input())
ans = 1 + floor(sqrt(4 * t - 3))
print(ans)


import math
n = int(input())
if n == 1 or n == 2:
	print(n + 1)
	exit()
if int(math.sqrt(n)) ** 2 == n:
	print(int(2 * math.sqrt(n)))
else:
	k = int(math.sqrt(n))
	l = k + 1
	if n > k ** 2 and n < l ** 2 - l + 1:
		print(2 * k + 1)
	elif n > k ** 2 + k and n < l ** 2:
		print(2 * l)


n = int(input())
j = int(n ** 0.5)
if n == j ** 2:
	print(2 * j)
elif n <= j * (j + 1):
	print(2 * j + 1)
else:
	print(2 * j + 2)


import bisect

def solve(n):
	if n == 1:
		return 2
	dp = []
	dp.append(0)
	dp.append(1)
	dp.append(2)
	for i in range(2, 32000):
		dp.append(dp[-1] + i)
		dp.append(dp[-1] + i)
	x = bisect.bisect_right(dp, n)
	if dp[x - 1] == n:
		return x
	return x + 1
n = int(input())
print(solve(n))


def main():
	n = int(input())
	ans = 1000000000
	i = 1
	while i * i <= n:
		ans = min(ans, (n + i - 1) // i + i)
		i += 1
	print(ans)
	return 0
main()


import math
n = int(input())
v1 = int(n ** 0.5)
v2 = math.ceil(n / v1)
print(v1 + v2)


from math import ceil as c, floor as f
n = int(input())
k = f(n ** 0.5)
x = c((n - k * k) / (k * 1.0))
print(x + k * 2)


MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
(n,) = I()
m = 1
for i in range(1, 100000):
	if i ** 2 <= n:
		m = i
	else:
		break
n -= m ** 2
print(2 * m + (n != 0 and n <= m) + (n > m) * 2)


k = lambda : list(map(int, input().split()))
(n,) = k()
(answer, a, b) = (2, 1, 1)
while a * b < n:
	answer += 1
	if a < b:
		a += 1
	else:
		b += 1
print(answer)


from math import sqrt
n = int(input())
a = int(sqrt(n))
if n == 1:
	print(2)
elif n == 2:
	print(3)
else:
	l = []
	if a * a - n >= 0:
		print(2 * a)
	elif a * (a + 1) >= n:
		print(a * 2 + 1)
	elif (a + 1) * (a + 1) >= n:
		print(2 * (a + 1))


n = int(input())
s = round(n ** (1 / 2))
listPossibilities = [[s, s], [s, s + 1], [s + 1, s + 1]]
output = []
for pair in listPossibilities:
	if pair[0] * pair[1] == sum(pair) and pair[0] * pair[1] >= n:
		output.append(sum(pair))
	elif pair[0] * pair[1] >= n and abs(pair[0] - pair[1]) <= 2:
		output.append(sum(pair))
print(min(output))


import math
n = eval(input())
z = math.ceil(math.sqrt(n))
x = n // z
if x * z < n:
	x += 1
print(x + z)


from math import ceil
from math import sqrt
n = int(input())
if n == 1:
	print(2)
elif n == 2:
	print(3)
else:
	x = ceil(sqrt(n))
	print(x + ceil(n / x))


sides = int(input())
a = b = 1
while a * b < sides:
	if a < b:
		a += 1
	else:
		b += 1
print(a + b)


import math
n = int(input())
if n == 1:
	print(2)
elif n == 2:
	print(3)
elif n == 3:
	print(4)
elif n == 4:
	print(4)
elif n > 4:
	l = math.sqrt(n)
	r = math.floor(l)
	if math.ceil(l) == math.floor(l):
		print(2 * r)
	elif r * r < n <= r * (r + 1):
		print(1 + 2 * r)
	else:
		print(2 * (r + 1))


import math
from collections import deque

def get_res(N):
	x = math.floor(N ** 0.5)
	y = math.ceil(N ** 0.5)
	if N == x * x:
		return 2 * x
	elif N >= x * x + 1 and N <= x * x + x:
		return 2 * x + 1
	elif N >= x * (x + 1) + 1 and N <= (x + 1) * (x + 1):
		return 2 * x + 2
N = int(input())
result = get_res(N)
print('{}'.format(result))


n = int(input())
from math import ceil

def res(n):
	return ceil(2 * n ** 0.5)
print(res(n))


from math import ceil, sqrt
a = int(input())
print(ceil(sqrt(a) * 2))


n = int(input())
left = 0
right = n + 1
while left + 1 < right:
	mid = (left + right) // 2
	b1 = mid / 2
	b2 = (mid + 1) / 2
	a1 = mid - b1
	a2 = mid - b2
	if a1 * b1 >= n or a2 * b2 >= n:
		right = mid
	else:
		left = mid
print(right)


from math import ceil
n = int(input())
s1 = ceil(n ** 0.5)
s2 = ceil(n / s1)
print(s1 + s2)


import math

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())
n = ii()
root = int(pow(n, 0.5))
num = root * root
if n == num:
	ans = 2 * root
else:
	ans = 2 * root + (1 if n - num <= root else 2)
print(ans)


n = int(input())
print(int((4 * n - 3) ** (1 / 2)) + 1)


nSquares = int(input())
x = y = int(nSquares ** (1 / 2))
aumentaX = False
while x * y < nSquares:
	if aumentaX:
		x += 1
	else:
		y += 1
	aumentaX = not aumentaX
print(x + y)


import math
n = int(input())
ans = int(math.sqrt(n))
while ans * int(math.sqrt(n)) < n:
	ans += 1
print(ans + int(math.sqrt(n)), end='')


import math
n = int(input())
a = math.ceil(math.sqrt(n) * 2)
print(a)


n = int(input())
a = 2
c = 1
b = 1
while True:
	if b >= n:
		print(a)
		import sys
		sys.exit(0)
	b += c
	a += 1
	if a % 2 == 1:
		c += 1


n = int(input())
q = int(n ** 0.5)
if q * q == n:
	print(2 * q)
elif n > q * (q + 1):
	print(2 * q + 2)
else:
	print(q + q + 1)


import math

def solve(n):
	if n == 1:
		return 2
	elif n == 2:
		return 3
	else:
		sides = math.ceil(math.sqrt(n))
		sides += math.ceil(n / sides)
		return sides
n = int(input())
print(solve(n))


from math import ceil
from math import sqrt
n = int(input())
print(ceil(sqrt(4 * n)))


import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
from collections import defaultdict
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree1:

	def __init__(self, data, default=2 * 10 ** 9, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] < key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater

class TrieNode:

	def __init__(self):
		self.children = [None] * 26
		self.isEndOfWord = False

class Trie:

	def __init__(self):
		self.root = self.getNode()

	def getNode(self):
		return TrieNode()

	def _charToIndex(self, ch):
		return ord(ch) - ord('a')

	def insert(self, key):
		pCrawl = self.root
		length = len(key)
		for level in range(length):
			index = self._charToIndex(key[level])
			if not pCrawl.children[index]:
				pCrawl.children[index] = self.getNode()
			pCrawl = pCrawl.children[index]
		pCrawl.isEndOfWord = True

	def search(self, key):
		pCrawl = self.root
		length = len(key)
		for level in range(length):
			index = self._charToIndex(key[level])
			if not pCrawl.children[index]:
				return False
			pCrawl = pCrawl.children[index]
		return pCrawl != None and pCrawl.isEndOfWord

class Node:

	def __init__(self, data):
		self.data = data
		self.count = 0
		self.left = None
		self.right = None

class BinaryTrie:

	def __init__(self):
		self.root = Node(0)

	def insert(self, pre_xor):
		self.temp = self.root
		for i in range(31, -1, -1):
			val = pre_xor & 1 << i
			if val:
				if not self.temp.right:
					self.temp.right = Node(0)
				self.temp = self.temp.right
				self.temp.count += 1
			if not val:
				if not self.temp.left:
					self.temp.left = Node(0)
				self.temp = self.temp.left
				self.temp.count += 1
		self.temp.data = pre_xor

	def query(self, xor):
		self.temp = self.root
		for i in range(31, -1, -1):
			val = xor & 1 << i
			if not val:
				if self.temp.left and self.temp.left.count > 0:
					self.temp = self.temp.left
				elif self.temp.right:
					self.temp = self.temp.right
			elif self.temp.right and self.temp.right.count > 0:
				self.temp = self.temp.right
			elif self.temp.left:
				self.temp = self.temp.left
			self.temp.count -= 1
		return xor ^ self.temp.data
n = int(input())
ans = 10 ** 9 + 1
for i in range(1, 10 ** 5 + 1):
	j = int(math.ceil(n / i))
	ans = min(ans, i + j)
print(ans)


from math import sqrt
from math import ceil
import sys
input = sys.stdin.readline
n = int(input())
print(ceil(sqrt(n) * 2))


n = int(input())
x = int(n ** 0.5)
if n == x ** 2:
	print(2 * x)
elif n > x ** 2 and n <= x ** 2 + x:
	print(2 * x + 1)
else:
	print(2 * x + 2)


import math
x = int(input())
y = math.ceil(math.sqrt(x))
z = math.ceil(x / y)
print(z + y)


from math import ceil
n = int(input())
c = ceil(n ** 0.5)
print(c + (n + c - 1) // c)


n = int(input())
import math
x = int(math.sqrt(n)) * 2
total = (x // 2) ** 2
while total < n:
	x += 1
	if x % 2 == 1:
		total = total + x // 2
	else:
		total = (x // 2) ** 2
print(x)


sq = int(input())
h = int(sq ** 0.5)
if h ** 2 == sq:
	print(2 * h)
elif h ** 2 + h >= sq:
	print(2 * h + 1)
elif h ** 2 + 2 * h >= sq:
	print(2 * h + 2)


memo = [0] * (10 ** 5 + 1)
memo[2] = 1
add = 1
for i in range(3, len(memo)):
	memo[i] = memo[i - 1] + add
	if i % 2 == 1:
		add += 1
N = int(input())
for i in range(2, len(memo)):
	if memo[i - 1] + 1 <= N <= memo[i]:
		print(i)
		exit()


import sys, math
input = sys.stdin.readline
L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
n = int(input())
if n == 1:
	print(2)
else:
	k = int(math.sqrt(n))
	m = k
	k = k * (k + 1)
	if m ** 2 == n:
		print(2 * m)
	elif n <= k:
		print(2 * m + 1)
	else:
		print(2 * (m + 1))


n = int(input())
ans = int(10000000000000)
for i in range(n + 2):
	if i != 0 and i <= n:
		ans = min(ans, i + (n + i - 1) // i)
	if i * i > n + 5:
		break
print(ans, end='\n')


from math import *
n = int(input())
print(ceil(sqrt(n) * 2))


n = int(input())
h = 1
v = 1
s = 1
hf = 1
vf = 0
while s < n:
	if hf == 1:
		h = h + 1
		s = s + v
		hf = 0
		vf = 1
	else:
		v = v + 1
		s = s + h
		hf = 1
		vf = 0
print(v + h)


n = int(input())
a = int(n ** 0.5)
if a ** 2 == n:
	print(2 * a)
elif n <= a + a ** 2:
	print(2 * a + 1)
else:
	print(2 * a + 2)


def compute(n):
	k = int(n ** 0.5)
	num = 2 + 2 * (k - 1)
	diff = n - k ** 2
	if diff > 0:
		num = num + 1
	if diff > k:
		num = num + 1
	return num

def main():
	n = int(input())
	print(compute(n))
main()


import math
n = int(input())
p = int(math.sqrt(n))
kp = p ** 2
o = n - kp
st = math.ceil(o / p)
print(st + p * 2)


n = int(input())
p = int(n ** 0.5)
if n == p * p:
	print(2 * p)
elif n <= p * (p + 1):
	print(2 * p + 1)
else:
	print(2 * p + 2)


import math
n = input()
a = math.floor(math.sqrt(int(n))) ** 2
b = (math.floor(math.sqrt(int(n))) + 1) ** 2
if int(n) == a:
	print(2 * math.floor(math.sqrt(a)))
elif (b + a) / 2 < int(n):
	print(2 * math.floor(math.sqrt(a)) + 2)
else:
	print(2 * math.floor(math.sqrt(a)) + 1)


from math import sqrt
n = int(input())
p = int(sqrt(n))
a = p ** 2
z = n - a
if z == 0:
	print(p * 2)
else:
	if z - p <= 0:
		print(p * 2 + 1)
	if z - p > 0:
		print(p * 2 + 2)


n = input()
n = int(n)
m = n ** 0.5
m = int(m)
if m * m == n:
	print(2 * m)
elif m * (m + 1) >= n:
	print(2 * m + 1)
else:
	print(2 * m + 2)


import math
x = eval(input())
r = math.ceil(math.sqrt(x))
r2 = math.ceil(x / r)
print(r + r2)


import sys
input = sys.stdin.readline

def main():
	n = int(input())

	def f(n):
		k = n // 2
		return k * (k + 1) if n % 2 else k ** 2

	def bs(l, r, v):
		while l <= r:
			m = l + r >> 1
			k = f(m)
			if k == v:
				return m
			if v < k:
				r = m - 1
			else:
				l = m + 1
		return l
	print(bs(0, int(100000.0), n))
main()


n = int(input())
rt = n ** 0.5
if rt % 1 > 0.5:
	b = int(rt) + 1
else:
	b = int(rt)
q = n // b
if n % b != 0:
	q += 1
print(q + b)


from math import ceil
N = int(input())
if N == 1:
	print(2)
	exit()
Temp = ceil(N ** 0.5)
print(Temp * 2 - 1 if N <= Temp ** 2 - Temp else Temp * 2)


import sys
input = sys.stdin.readline

def main():
	n = int(input())
	ans = 4 * n
	for a in range(1, 10 ** 5 + 1):
		ans = min(ans, a + (n + a - 1) // a)
	print(ans)
main()


n = int(input())
l = 0
r = n
while r - l > 1:
	m = (l + r) // 2
	if m * m >= n:
		r = m
	else:
		l = m
if (r - 1) * r >= n:
	print(2 * r - 1)
else:
	print(2 * r)


import math
n = int(input())
ans = 10 ** 9 + 7
for i in range(1, int(math.sqrt(n)) + 1):
	if n % i == 0:
		ans = min(ans, i + n // i)
	else:
		ans = min(ans, i + n // i + 1)
print(ans)


n = int(input())
s1 = 1
s2 = 1
while s1 * s2 < n:
	if s1 == s2:
		s1 += 1
	else:
		s2 += 1
print(s1 + s2)


n = int(input())
x = 1
x1 = 1
while n > x * x1:
	if x >= x1:
		x1 += 1
	if x1 * x >= n:
		break
	x += 1
print(x + x1)


import sys
import math

def square(n):
	sqr = math.sqrt(n)
	upper = int(math.ceil(sqr))
	lower = int(math.floor(sqr))
	if upper == lower:
		return lower * 2
	elif lower * lower + lower >= n:
		return lower * 2 + 1
	else:
		return upper * 2

def main():
	n = int(sys.stdin.readline())
	print(square(n))
main()


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


from math import ceil
n = int(input())
x = ceil(n ** 0.5)
print(x + 1 + ceil((n - x) / x))


n = int(input())
le = 1
ri = 10 ** 10
while le + 1 < ri:
	m = (le + ri) // 2
	a = m // 2
	b = m - a
	kv = a * b
	if kv < n:
		le = m
	else:
		ri = m
print(ri)


import math
n = int(input())
sq = math.sqrt(n)
sq_ceil = math.ceil(sq)
if n <= (sq_ceil - 1) * sq_ceil:
	out = 2 * sq_ceil - 1
else:
	out = 2 * sq_ceil
print(out)


import math

def f(n):
	s = int(math.sqrt(n))
	if s * s >= n:
		return s << 1
	if s * (s + 1) >= n:
		return (s << 1) + 1
	return (s << 1) + 2
n = int(input())
print(f(n))


def main():
	n = int(input())
	(ret, x) = (n + 1, 1)
	while x ** 2 <= n:
		if n % x == 0:
			y = n // x
		else:
			y = n // x + 1
		ret = min(ret, x + y)
		x += 1
	print(ret)
main()


s = 1
n = int(input())
a = 1
b = 1
while s < n:
	if a == b:
		b = b + 1
		s = s + a
	elif b > a:
		a = a + 1
		s = s + b
if s >= n:
	print(a + b)


import math

def solve(n):
	for q in range(int(math.sqrt(n)), 100000000000000):
		no = q
		if no * (no - 1) >= n:
			return 2 * no - 1
		elif no * no >= n:
			return 2 * no
		elif no * (no + 1) >= n:
			return 2 * no + 1
n = int(input())
if n == 1:
	print(2)
elif n == 2:
	print(3)
else:
	print(solve(n))


n = int(input())
(i, j) = (1, 1)
while n > j:
	i += 1
	j = i ** 2
if n <= (i - 1) ** 2 + i - 1:
	print(2 * (i - 1) + 1)
else:
	print(i * 2)


n = int(input())
x = 0
x1 = 1
x2 = 1
while x1 * x2 < n:
	if x % 2 == 0:
		x1 += 1
		x += 1
	else:
		x += 1
		x2 += 1
print(x1 + x2)


n = int(input())
ans = 0
if n == 1:
	print(2)
elif n == 2:
	print(3)
elif n == 3:
	print(4)
else:
	x = n ** 0.5
	if x - int(x) > 0:
		x = int(x)
		x = x + 1
	else:
		x = int(x)
	y = 2 * x
	if x ** 2 - (x - 1) <= n:
		ans = y
	else:
		ans = y - 1
	print(ans)


import math
n = int(input())
t = 10000000
val = math.ceil(2 * math.sqrt(n))
print(val)


__author__ = 'Esfandiar'
from math import sqrt, ceil
n = int(input())
yy = int(sqrt(n))
res = 2 * yy
n -= yy * yy
while n > 0:
	res += 1
	n -= yy
print(res)


import sys
import os
import math
import copy
from math import gcd
from bisect import bisect
from io import BytesIO, IOBase
from math import sqrt, floor, factorial, gcd, log, ceil
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
import itertools

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

def Mint():
	return map(int, sys.stdin.readline().split())

def Lstr():
	return list(sys.stdin.readline().strip())

def Str():
	return sys.stdin.readline().strip()

def Mstr():
	return map(str, sys.stdin.readline().strip().split())

def List():
	return list(map(int, sys.stdin.readline().split()))

def Hash():
	return dict()

def Mod():
	return 1000000007

def Ncr(n, r, p):
	return fact[n] * (ifact[r] * ifact[n - r] % p) % p

def Most_frequent(list):
	return max(set(list), key=list.count)

def Mat2x2(n):
	return [List() for _ in range(n)]

def Lcm(x, y):
	return x * y // gcd(x, y)

def dtob(n):
	return bin(n).replace('0b', '')

def btod(n):
	return int(n, 2)

def solution():
	n = Int()
	print(ceil(2 * n ** 0.5))
solution()


import math
n = int(input())
s = math.sqrt(n)
len = int(s)
tmp = len ** 2
ans = tmp // len + len
if s % 1 != 0:
	if n - tmp <= len:
		ans += 1
	else:
		ans += 2
print(ans)


import math
i = int(input())
if math.sqrt(i) - int(math.sqrt(i)) == 0:
	print(int(math.sqrt(i)) * 2)
elif math.sqrt(i) - int(math.sqrt(i)) < 0.5:
	print(int(math.sqrt(i)) * 2 + 1)
else:
	print((int(math.sqrt(i)) + 1) * 2)


import math
n = int(input())
s = math.sqrt(n)
p = int(s)
if int(s) == float(s):
	print(int(s + s))
elif n > p ** 2 and n <= p ** 2 + p:
	print(2 * p + 1)
elif n > p ** 2 + p and n <= (p + 1) ** 2:
	print(2 * (p + 1))


from math import *
from collections import *
from itertools import *
from bisect import *
from heapq import *
from operator import *

def io():
	return map(int, input().split())

def op():
	return list(map(int, input().split()))

def kl(con, x=0):
	if x == 0:
		print('Yes') if con else print('No')
	elif x == 1:
		print('yes') if con else print('no')
	elif x == 2:
		print('YES') if con else print('NO')
MOD = 1000000007
MAX = 2147483647
MIN = -2147483648
i = input
n = int(i())
t = int(sqrt(n))
x = t * 2
total = t * t
while total < n:
	x += 1
	if x & 1:
		total += x // 2
	else:
		total = (x // 2) ** 2
print(x)


n = int(input())
x = int(n ** 0.5)
i = x
while 1:
	if x * i >= n:
		print(x + i)
		break
	i += 1


import math

def primeFactors(n):
	ar = []
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			ar.append(i)
			ar.append(n // i)
	return ar
n = int(input())
if n == 1:
	print(2)
elif n == 2:
	print(3)
elif n == 3:
	print(4)
else:
	a = primeFactors(n)
	a.append(1)
	a.append(n)
	a.sort()
	le = len(a)
	va2 = a[le // 2 - 1] + a[le // 2]
	x = int(math.sqrt(n))
	va = 2 * x
	if n - x * x == 0:
		va += 0
	elif n - x * x <= x:
		va += 1
	else:
		va += 2
	print(va)


n = int(input())
i = 1
while i * i < n:
	i += 1
mx = i
if i * (i - 1) < n:
	print(2 * i)
else:
	print(2 * i - 1)


n = int(input())
i = 1
j = 1
k = 0
while i * j < n:
	if k % 2 == 0:
		i += 1
	else:
		j += 1
	k = 1 - k
print(i + j)


n = int(input())
if n == 1:
	print(2)
elif n == 2:
	print(3)
else:
	i = 2
	ans = 4
	while 1:
		dig = i ** 2
		if n <= dig:
			print(ans)
			break
		elif n > dig and dig + i >= n:
			print(ans + 1)
			break
		else:
			ans += 2
		i += 1


import math
n = int(input())
sq = int(math.sqrt(n))
print(sq + (n + sq - 1) // sq)


import sys
import math
import bisect

def solve(n):
	min_cost = 10 ** 18
	for i in range(1, math.ceil(math.sqrt(n)) + 1):
		j = (n + i - 1) // i
		cost = i + j
		min_cost = min(min_cost, cost)
	return min_cost

def main():
	n = int(input())
	print(solve(n))
main()


n = eval(input())
x = y = 1
while x * y < n:
	if x < y:
		x += 1
	else:
		y += 1
print(x + y)


import math
n = int(input())
if n == 1:
	print(2)
elif n == 2:
	print(3)
elif n == 3:
	print(4)
elif int(math.sqrt(n)) == math.sqrt(n):
	print(int(2 * math.sqrt(n)))
else:
	d = int(math.sqrt(n))
	if n - d * d < (d + 1) * (d + 1) - n:
		print(2 * d + 1)
	else:
		print(2 * (d + 1))


n = int(input())
for i in range(1, 40000):
	if i * i >= n:
		x = i
		break
print(n // x + i + int(n % x > 0))


from math import floor, ceil, sqrt
from sys import exit
n = int(input())
if n == 1:
	print(2)
	exit()
if n == 2:
	print(3)
	exit()
if n == 3:
	print(4)
	exit()
n_r = int(sqrt(n))
nearest = n_r ** 2
ans = 2 * n_r
t = n - nearest
if t > 0:
	ans += int(ceil(t / n_r))
print(ans)


import math
n = int(input())
h = math.ceil(n ** 0.5)
w = math.ceil(n / h)
print(h + w)


import math
a = int(input())
lb = int(math.sqrt(a))
if lb == math.sqrt(a):
	print(lb * 2)
elif lb + lb * lb >= a:
	print(lb * 2 + 1)
else:
	print(lb * 2 + 2)


import sys
from math import ceil, sqrt
read = sys.stdin.buffer.readline
mi = lambda : map(int, read().split())
li = lambda : list(mi())
cin = lambda : int(read())
for _ in range(1):
	n = cin()
	sq = int(sqrt(n))
	req = n - sq * sq
	ans = 2 * sq
	while req > 0:
		ans += 1
		req -= sq
		sq += 1
	print(ans)


import math
t = int(input())
p = int(math.sqrt(t))
if pow(p, 2) == t:
	p = p
else:
	p = p + 1
val1 = p * p - t
val2 = (p - 1) * (p - 1) - t
val3 = (p - 1) * p - t
st1 = 100000000000
st2 = 100000000000
st3 = 100000000000
if val1 >= 0:
	st1 = p + p
if val2 >= 0:
	st2 = p + p - 2
if val3 >= 0:
	st3 = p + p - 1
x = min(st1, st2)
y = min(x, st3)
print(y)


import math
n = int(input())
upper = math.floor(math.sqrt(n)) + 1
ans = float('inf')
for i in range(1, upper):
	cur = i
	cur += n // i
	if n % i != 0:
		cur += 1
	ans = min(ans, cur)
print(ans)


n = int(input())
(a, b) = (int(n ** 0.5), int(n ** 0.5))
fl = 0
j = a * b
while j < n:
	if fl == 0:
		a += 1
		j += b
	else:
		b += 1
		j += a
	fl = (fl + 1) % 2
print(a + b)


import math
n = int(input())
x = math.ceil(math.sqrt(n))
y = math.ceil(n / x)
print(x + y)


import math
n = int(input())
k = math.floor(math.sqrt(n))
one = k * k
two = (k + 1) * k
three = (k + 1) * (k + 1)
if two < n <= three:
	print(2 * k + 2)
elif one < n <= two:
	print(2 * k + 1)
else:
	print(2 * k)


n = int(input())
if n == 1:
	print(2)
elif n == 2:
	print(3)
else:
	m = int(n ** (1 / 2))
	if n != m * m:
		m += 1
	if n > m * m - m:
		print(m * 2)
	else:
		print(m * 2 - 1)


from operator import itemgetter
n = int(input())
a = int(n ** 0.5)
b = a
if a * b >= n:
	print(a + b)
elif a * (b + 1) >= n:
	print(a + b + 1)
else:
	print(a + b + 2)


from math import sqrt

def nearest_square(num):
	lhv = int(sqrt(num)) ** 2
	rhv = (int(sqrt(num)) + 1) ** 2
	ld = num - lhv
	rd = rhv - num
	if rd > ld:
		return lhv
	else:
		return rhv
number = int(input())
if number == 1:
	print(2)
elif number == 2:
	print(3)
elif number == int(sqrt(number)) ** 2:
	print(int(sqrt(number)) * 2)
elif number > nearest_square(number):
	print(int(sqrt(nearest_square(number))) * 2 + 1)
elif number < nearest_square(number):
	print(int(sqrt(nearest_square(number))) * 2)


n = int(input())
x = int(n ** 0.5)
if x ** 2 != n:
	if x * (x + 1) < n:
		print(2 * x + 2)
	else:
		print(2 * x + 1)
else:
	print(2 * x)


import sys
import math
n = int(input())
ans = 1 + n
for i in range(1, int(math.sqrt(n)) + 1):
	ans = min(ans, i + int(math.ceil(n / i)))
print(ans)


n = int(input().strip())
import math
if n == 1:
	print(2)
elif n == 2:
	print(3)
else:
	to_square = math.ceil(math.sqrt(n))
	if to_square * to_square - to_square >= n:
		print(to_square * 2 - 1)
	else:
		print(to_square * 2)


n = int(input())
ans = []
for i in range(1, 100000):
	ans.append(i + (n - 1) // i + 1)
print(min(ans))


n = int(input())
i = 0
r = 1
i += 2
if r >= n:
	print(i)
	exit()
r += 1
i += 1
if r >= n:
	print(i)
	exit()
diff = 2
while r < n:
	r += diff
	i += 1
	if r >= n:
		break
	r += diff
	i += 1
	diff += 1
print(i)


import math
n = int(input())
i = int(math.sqrt(n))
if i * i < n <= i * i + 1 * i:
	print(2 * i + 1)
elif n == i * i:
	print(2 * i)
elif i * i + 1 * i < n <= i * i + 2 * i:
	print(2 * i + 2)


import math as m
n = int(input())
a = int(m.sqrt(n))
b = m.ceil(m.sqrt(n))
if a == b:
	print(2 * a)
elif a * a < n < (a * a + b * b) / 2:
	print(2 * b - 1)
else:
	print(2 * b)


start = int(input())
x = start ** 0.5
x = int(x)
total = x * 2
temp = x ** 2
extra = (start - temp) / x
if extra % 1 != 0:
	total += int(extra) + 1
else:
	total += extra
print(int(total))


import math
n = int(input())
if n <= 2:
	print(n + 1)
	exit()
sqr = math.sqrt(n)
if sqr == int(sqr):
	print(int(sqr + sqr))
	exit()
else:
	sqr1 = math.ceil(math.sqrt(n))
	sqr2 = sqr1 - 1
	opt1 = sqr1 + math.ceil(n / sqr1)
	opt2 = sqr2 + math.ceil(n / sqr2)
	print(min(opt1, opt2))


num = int(input())
start = int(num ** 0.5)
t = start ** 2
if num > t + start:
	print(start * 2 + 2)
elif num > t:
	print(start * 2 + 1)
else:
	print(start * 2)


n = int(input())
a = 1
b = 1
c = 0
for i in range(n):
	if a * b >= n:
		c = a + b
		break
	if a < b:
		a += 1
	else:
		b += 1
print(c)


import math
N = int(input())
n = 0
S = 0
while True:
	if n >= N:
		print(S)
		break
	elif n == 0:
		S = S + 2
		n = n + 1
	else:
		F = math.ceil(S / 2)
		S = S + 1
		n = n + F


import math
x = eval(input())
sum = x ** 0.5
sum = math.ceil(sum)
print(sum + math.ceil(x / sum))


from math import sqrt
n = int(input())
lam = sqrt(n)
jam = lam // 1
x = jam + 1
y = 2
kam = jam
while kam < n:
	x += 1
	kam = jam * y
	y += 1
print(int(x))


I = lambda : map(int, input().split())
Y = lambda : int(input())
n = Y()
import math
x = math.ceil(n ** 0.5)
print(math.ceil(n / x) + x)


n = int(input())
m = 1
k = 1
while m * k < n:
	if m == k:
		m += 1
	else:
		k += 1
print(m + k)


from math import *

def main():
	n = int(input())
	a = 0
	b = 0
	val = 10 ** 10
	u = int(n ** 0.5)
	if u * u >= n:
		print(2 * u)
	elif u * u + u >= n:
		print(2 * u + 1)
	else:
		print(2 * u + 2)
main()


import math
n = int(input())
divisors = []
min_ = 1e+19
for i in range(1, int(math.sqrt(n)) + 1):
	divisors.append((i, n // i, n % i))
for pair in divisors:
	if pair[0] + pair[1] + int(pair[2] != 0) < min_:
		min_ = pair[0] + pair[1] + int(pair[2] != 0)
print(min_)


from collections import deque
import pdb
from math import *

def rI():
	return [int(i) for i in input().split()]
n = rI()[0]
if n == 2:
	print(3)
else:
	print(ceil(sqrt(n) * 2))


import math
n = int(input())
t = int(math.sqrt(n))
if t * t == n:
	print(2 * t)
else:
	q = (n - 1) // t
	q += 1
	print(t + q)


import math
n = int(input())
sq = int(math.sqrt(n))
dif = n - sq * sq
add = 0
if dif > sq:
	add = 2
elif dif != 0:
	add = 1
print(2 * sq + add)


import math
n = int(input())
r = math.sqrt(n)
if r == math.floor(r):
	print(int(r * 2))
else:
	floor_r = math.floor(r)
	chk = floor_r * (floor_r + 1)
	if chk >= n:
		print(floor_r * 2 + 1)
	else:
		print(floor_r * 2 + 2)


import math
n = int(input())
k = round(math.sqrt(n))
if n <= k * k:
	a = 2 * k
else:
	a = 2 * k + 1
print(a)


from math import ceil
n = int(input())
m = ceil(n ** 0.5)
print(m + ceil(n / m))


n = int(input())
a = int(n ** 0.5)
s = 0
s += a * 2
s += (n - a ** 2 + a - 1) // a
print(s)


n = int(input())
if int(n ** 0.5) ** 2 == n:
	print(int(2 * n ** 0.5))
else:
	lower = int(n ** 0.5)
	s = 0
	if lower * (lower + 1) >= n:
		s = 2 * lower + 1
	else:
		s = 2 * lower + 2
	print(s)


n = int(input())
x = int(n ** 0.5)
a = 0
r = n - x * x
if r != 0:
	if r % x != 0:
		a += 1
	a += r // x
a += 2 * x
print(a)


import bisect
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate

def list_input():
	return list(map(int, input().split()))

def num_input():
	return map(int, input().split())

def string_list():
	return list(input())

def isPerfect(N):
	if sqrt(N) - math.floor(sqrt(N)) != 0:
		return False
	return True
n = int(input())
print(int((4 * n - 3) ** 0.5) + 1)


import math

def main():
	n = int(input())
	print(int(math.ceil(math.sqrt(n) * 2)))
main()


n = int(input())
i = 1
while i ** 2 < n:
	i += 1
if n % i == 0:
	print(i + n // i)
else:
	print(i + n // i + 1)


from math import *
n = int(input())
if n == 1:
	print(2)
elif n == 2:
	print(3)
elif n == 3:
	print(4)
elif sqrt(n) == int(sqrt(n)):
	print(int(sqrt(n) * 2))
elif sqrt(n) - int(sqrt(n)) < 0.5:
	print(int(sqrt(n)) * 2 + 1)
else:
	print(int(sqrt(n)) * 2 + 2)


def ceil(x, p):
	return (x + p - 1) // p
n = int(input())
(i, ans) = (1, 6666666666666)
while i * i <= n:
	ans = min(ans, ceil(n, i) + i)
	i += 1
print(ans)


ans = 10 ** 9
n = int(input())
i = 1
while i * i <= n:
	ans = min(ans, i + (n - 1) // i + 1)
	i += 1
print(ans)


import math
n = int(input())
a = math.floor(math.sqrt(n))
b = math.ceil(math.sqrt(n))
if a * b >= n:
	print(a + b)
else:
	print(2 * b)


from math import sqrt as srt
from math import ceil
n = int(input())
print(ceil(srt(n) * 2))


import math
n = int(input())
if n <= 3:
	print(n + 1)
else:
	s = int(math.sqrt(n))
	p = n - s ** 2
	if p == 0:
		print(2 * s)
	elif s ** 2 + 1 <= n <= s ** 2 + s:
		print(2 * s + 1)
	else:
		print(2 * s + 2)


gi = lambda : list(map(int, input().split()))
(n,) = gi()
(ans, a, b) = (2, 1, 1)
while a * b < n:
	ans += 1
	if a < b:
		a += 1
	else:
		b += 1
print(ans)


from math import sqrt
n = int(input())
mul1 = int(sqrt(n))
mul2 = mul1
while mul2 * mul1 < n:
	mul2 += 1
print(mul1 + mul2)


n = int(input(''))
temp = 1
su = 0
count = -1
while su < n:
	for i in range(2):
		su += temp
		count += 1
		if su >= n:
			break
	temp += 1
print(count + 2)


from math import ceil
n = int(input())
if n == 1:
	print(2)
	exit(0)
cols = int(n ** 0.5)
ans = cols + 1
n -= cols
ans += int(ceil(n / cols))
print(ans)


class Solution(object):

	def solve(self):
		n = int(input().strip())
		lower = pow(n, 0.5)
		upper = int(lower) if lower == int(lower) else int(lower) + 1
		lower = int(lower)
		if upper * lower >= n:
			return upper + lower
		return 2 * upper
sol = Solution()
print(sol.solve())


import math
n = int(input())
sqrt_n = math.sqrt(n)
sqrt_n_floor = float(int(sqrt_n))
if sqrt_n - sqrt_n_floor == 0.0:
	print(2 * int(sqrt_n))
else:
	sqrt_n_floor = int(sqrt_n_floor)
	if n <= int(sqrt_n_floor ** 2) + sqrt_n_floor:
		print(2 * int(sqrt_n_floor) + 1)
	else:
		print(2 * int(sqrt_n_floor) + 2)


import math
n = int(input())
n = math.sqrt(n) * 2
if n % 1 != 0.0:
	n = int(n) + 1
else:
	n = int(n)
print(n)


from sys import stdin
from math import sqrt
n = int(stdin.readline())
a = int(sqrt(n))
b = a
if a * b == n:
	print(2 * a)
else:
	while a * b < n:
		b += 1
	print(a + b)


from math import sqrt
n_squares = int(input())
if n_squares == 1:
	print(2)
elif n_squares == 2:
	print(3)
else:
	s = sqrt(n_squares)
	if s % 1 > 0.5:
		print((int(s) + 1) * 2)
	elif s % 1 != 0:
		print(int(s) * 2 + 1)
	else:
		print(int(s) * 2)


import math
n = int(input())
if n <= 0:
	print(n)
	exit()
if n == 1:
	print(2)
	exit()
if n == 2:
	print(3)
	exit()
if n == 3:
	print(4)
	exit()
if n == 4:
	print(4)
	exit()
nn = int(n ** 0.5)
xx = nn * nn
if xx == n:
	print(2 * nn)
	exit()
else:
	print(math.ceil(n / nn) + nn)


import math as m
n = int(input())
x = m.sqrt(n)
if x == int(x):
	print(int(2 * x))
else:
	x = m.ceil(x)
	print(x + m.ceil(n / x))


n = int(input())
import math
x = int(math.sqrt(n))
ANS = float('inf')
for i in range(max(0, x - 100), x + 100):
	y = -(-n // x)
	if ANS > x + y:
		ANS = x + y
print(ANS)


import math

def read_nums():
	return [int(x) for x in input().split()]

def main():
	(n,) = read_nums()
	sqrt = math.floor(n ** 0.5)
	(w, h) = (sqrt - 1, sqrt - 1)
	flip = True
	while w * h < n:
		if flip:
			w += 1
		else:
			h += 1
		flip = not flip
	print(w + h)
main()


from math import *

def func1(n):
	i = 1
	ans1 = -1
	ans2 = -1
	while i <= sqrt(n):
		if n % i == 0:
			ans1 = i
			ans2 = n // i
		i += 1
	return (ans1, ans2)
n = int(input())
val = ceil(sqrt(n))
ans = val + val
val2 = (val * val - n) // val
ans -= val2
print(ans)


n = int(input())
if int(n ** 0.5) == n ** 0.5:
	print(int(n ** 0.5) * 2)
	exit()
ans = int(n ** 0.5) * 2
if (ans / 2) ** 2 + ans / 2 >= n:
	print(ans + 1)
else:
	print(ans + 2)


import math, sys, itertools
from fractions import *

def mp():
	return list(map(int, input().split()))

def main():
	n = int(input())
	s = int(math.sqrt(n))
	if s * s >= n:
		print(2 * s)
	elif s * (s + 1) >= n:
		print(2 * s + 1)
	else:
		print(2 * s + 2)
deb = 0
if deb:
	file = open('input.txt', 'w')
else:
	input = sys.stdin.readline
main()


def mi():
	return map(int, input().split())
from math import ceil
n = int(input())
t = int(ceil(n ** 0.5))
t1 = t ** 2
height = t
while t1 - t >= n:
	t1 -= t
	height -= 1
print(height + t)


from math import sqrt
import logging
logging.basicConfig(level=logging.DEBUG, format=' %(asctime)s - %(levelname)s- %(message)s')
logging.disable()

def check_nearest_square(n):
	i = 0
	while True:
		backend = sqrt(n - i)
		frontend = sqrt(n + i)
		if float(int(backend)) == backend:
			return n - i
		elif float(int(frontend)) == frontend:
			return n + i
		else:
			i += 1
		logging.debug('back is ' + str(backend) + ' and front is ' + str(frontend))

def main():
	squares = int(input())
	nearest_square = check_nearest_square(squares)
	logging.debug('nearest_square is' + str(nearest_square))
	if nearest_square == squares:
		print(int(sqrt(squares) * 2))
	elif nearest_square < squares:
		print(int(sqrt(nearest_square) * 2 + 1))
	else:
		print(int(sqrt(nearest_square) * 2))
main()


from math import sqrt

def get_sqs(n):
	if n % 2 == 0:
		return int(n / 2) ** 2
	else:
		return int(n / 2) ** 2 + int(n / 2)
n = int(input())
s = int(sqrt(4 * n))
for i in range(max(0, s - 2), s + 2):
	if n <= get_sqs(i):
		print(i)
		exit()


from math import sqrt, ceil, floor
n = int(input())
sq = floor(sqrt(n))
print(sq + ceil(n / sq))


from math import sqrt, ceil
n = int(input())
m = int(sqrt(n))
print(m + ceil(n / m))


from math import log2, ceil, sqrt
a = int(input())
print(ceil(sqrt(a)) + round(sqrt(a)))


import math
n = int(input())
x = math.floor(math.sqrt(n))
y = n - x ** 2
result = 2 * x + math.ceil(y / x)
print(result)


n = int(input())
f = int(n ** (1 / 2))
if n ** (1 / 2) - f == 0:
	print(2 * f)
else:
	if n <= f ** 2 + f:
		print(f + (f + 1))
	if n > f ** 2 + f:
		print(2 * (f + 1))


n = int(input())
if n == 1:
	print(2)
elif n == 2:
	print(3)
elif n == 3:
	print(4)
elif n == 4:
	print(4)
else:
	x = 4
	j = 2
	i = 5
	while True:
		if i % 4 == 1:
			x = x + j
		if i % 4 == 2:
			x = x + j + 1
		if i % 4 == 3:
			x = x + j + 1
		if i % 4 == 0:
			x = x + j + 2
			j = j + 2
		if x - n >= 0:
			print(i)
			break
		i = i + 1


from math import *
from itertools import *
from collections import *
from functools import reduce

def input_ints():
	return list(map(int, input().split()))

def input_floats():
	return list(map(float, input().split()))

def input_strings():
	return input().split()
n = int(input())
a = ceil(sqrt(n))
b = ceil(n / a)
print(a + b)


import math
n = int(input())
s = math.sqrt(n)
a = int(s)
if a ** 2 == n:
	r = 2 * a
elif a * (a + 1) >= n:
	r = a + a + 1
else:
	r = a + a + 2
print(r)


import math
import bisect
import itertools
import sys
I = lambda : sys.stdin.readline()
mod = 10 ** 9 + 7

def mindiff(a):
	b = a[:]
	b.sort()
	m = 10000000000
	for i in range(len(b) - 1):
		if b[i + 1] - b[i] < m:
			m = b[i + 1] - b[i]
	return m

def lcm(a, b):
	return a * b // math.gcd(a, b)

def merge(a, b):
	i = 0
	j = 0
	c = 0
	ans = []
	while i < len(a) and j < len(b):
		if a[i] < b[j]:
			ans.append(a[i])
			i += 1
		else:
			ans.append(b[j])
			c += len(a) - i
			j += 1
	ans += a[i:]
	ans += b[j:]
	return (ans, c)

def mergesort(a):
	if len(a) == 1:
		return (a, 0)
	mid = len(a) // 2
	(left, left_inversion) = mergesort(a[:mid])
	(right, right_inversion) = mergesort(a[mid:])
	(m, c) = merge(left, right)
	c += left_inversion + right_inversion
	return (m, c)

def is_prime(num):
	if num == 1:
		return False
	if num == 2:
		return True
	if num == 3:
		return True
	if num % 2 == 0:
		return False
	if num % 3 == 0:
		return False
	t = 5
	a = 2
	while t <= int(math.sqrt(num)):
		if num % t == 0:
			return False
		t += a
		a = 6 - a
	return True

def ceil(a, b):
	if a % b == 0:
		return a // b
	else:
		return a // b + 1

def binsearch(arr, b, low, high):
	if low == high:
		return low
	if arr[math.ceil((low + high) / 2)] < b:
		return binsearch(arr, b, low, math.ceil((low + high) / 2) - 1)
	else:
		return binsearch(arr, b, math.ceil((low + high) / 2), high)

def ncr1(n, r):
	s = 1
	for i in range(min(n - r, r)):
		s *= n - i
		s %= mod
		s *= pow(i + 1, mod - 2, mod)
		s %= mod
	return s

def calc(n, m, r):
	s = 0
	for i in range(0, r + 1, 2):
		s += ncr1(n, i) * ncr1(m, i)
		s %= mod
	return s
n = int(input())
k = math.ceil(n ** 0.5)
print(math.ceil(n / k) + k)


import math
n = int(input())
x = int(math.sqrt(n))
y = 10 ** 9
z = 10 ** 9
a = 10 ** 9
if x * x >= n:
	y = 2 * x
elif (x + 1) * x >= n:
	z = 2 * x + 1
elif (x + 1) * (x + 1) >= n:
	a = 2 * (x + 1)
print(min(y, z, a))


import math
n = int(input())
q = math.sqrt(n)
if q == int(q):
	q = int(q)
	print(2 * q)
elif q - int(q) >= 0.5:
	q = int(q) + 1
	print(2 * q)
else:
	q = int(q)
	print(2 * q + 1)


import math
n = int(input())
ns = math.sqrt(n)
print(math.ceil(ns * 2))


from math import sqrt
n = int(input())
x = int(sqrt(n))
x = max(0, x - 5)
ans = n + 1
for i in range(x, x + 11):
	for j in range(x, x + 11):
		if i * j >= n:
			ans = min(ans, i + j)
print(ans)


def f(n):
	import math
	p = math.sqrt(n)
	s = int(p)
	if n == 1:
		return 2
	elif s == p:
		return 2 * p
	elif n <= s * (s + 1):
		return 2 * s + 1
	else:
		return 2 * s + 2
n = int(input())
print(int(f(n)))


n = int(input())
h = int(n ** 0.5)
t = n
i = 0

def is_sqrt(a):
	d = int(a ** 0.5)
	if d ** 2 == a:
		return True
	else:
		False
if n == 2:
	print(3)
elif n == 3:
	print(4)
elif is_sqrt(n):
	print(h * 2)
else:
	while True:
		if is_sqrt(n):
			break
		else:
			n -= 1
			i += 1
	ans = int(i // int(n ** 0.5) + 1 + n ** 0.5 * 2)
	if i / int(n ** 0.5) != i // int(n ** 0.5):
		print(ans)
	else:
		print(ans - 1)


n = int(input())
k = 1
while k * k < n:
	k += 1
print(k + (n // k + (n % k > 0)))


n = int(input())
if n == 1:
	print('2')
else:
	sqacc = pow(n, 0.5)
	sq = int(sqacc)
	ans = 2 * sq + 1
	if sqacc == sq:
		ans -= 1
	elif n >= sq * sq + sq + 1:
		ans += 1
	print(ans)


def f(x):
	if x % 2 == 0:
		return (x // 2) ** 2
	else:
		return x // 2 * (x // 2 + 1)
n = int(input())
for i in range(2, 63246 + 1):
	if f(i) >= n:
		print(i)
		break


import math
n = int(input())
k = int(math.sqrt(n))
if k * k == n:
	print(2 * k)
elif k * (k + 1) >= n:
	print(str(2 * k + 1))
else:
	print(str(2 * k + 2))


n = int(input())
n2 = n ** 0.5
if n2 != int(n2):
	n2 = int(n2) + 1
	if (n2 - 1) * n2 >= n:
		cuts = n2 * 2 - 1
	else:
		cuts = n2 * 2
else:
	cuts = int(n2 * 2)
print(cuts)


n = int(input())
i = 0
while (i + 1) * (i + 1) <= n:
	i += 1
print(2 * i + (n - i * i + i - 1) // i)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import math
n = int(input())
s = math.sqrt(n) // 1
a = s
b = s + 1
if a * a >= n:
	ans = a + a
elif a * b >= n:
	ans = a + b
else:
	ans = b + b
print(int(ans))


inp = list(map(int, input().split()))
n = inp[0]
l = [0, 2, 3, 4, 4]
i = 5
count = 1
m = 0
while i <= n:
	if count == 1:
		l += [l[len(l) - 1] + 1]
		count += 1
		m = int(l[len(l) - 1] / 2)
		if i + m < n:
			i += m - 1
			count = 1
		i += 1
		continue
	elif count == m:
		l += [l[len(l) - 1]]
		count = 1
		i += 1
		continue
	else:
		l += [l[len(l) - 1]]
		count += 1
	i += 1
if n < 5:
	print(l[n])
else:
	print(l[len(l) - 1])


import sys
import math
from collections import defaultdict

def getInputFromLine():
	return [int(x) for x in input().split()]
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
n = int(input())
if n == 1:
	print(2)
elif n == 2:
	print(3)
elif n == 3 or n == 4:
	print(4)
else:
	l1 = round(math.sqrt(n))
	l2 = math.ceil(math.sqrt(n))
	ans = int(l1 + l2)
	print(ans)


n = int(input())
val = int(n ** 0.5)
ans = n // val
if n % val != 0:
	print(ans + val + 1)
else:
	print(ans + val)


import math
n = int(input())
a = int(math.sqrt(n))
f = 0
j = 0
ans = 0
for i in range(a + 2):
	temp = i * i
	if n > temp:
		f = i
	if n < temp:
		j = i
		break
	if n == temp:
		ans = i
		break
if ans == 0:
	if j * (j - 1) >= n:
		print(j + j - 1)
	else:
		print(j + j)
else:
	print(i + i)


n = int(input())
a = 1
b = 1
v = a * b
c = 0
while n > v:
	if c == 0:
		a += 1
		c = 1
	else:
		b += 1
		c = 0
	v = a * b
print(a + b)


n = int(input())
sq = int(n ** (1 / 2))
if sq ** 2 == n:
	print(2 * sq)
else:
	t = int(n - sq ** 2)
	if t > (sq + 1) ** 2 - n:
		print(2 * (sq + 1))
	else:
		print(2 * sq + 1)


entrada = int(input())
salida = 0
k = entrada ** 0.5
if int(k) * int(k) == entrada:
	salida = 2 * int(k)
elif int(k) * (int(k) + 1) >= entrada:
	salida = 2 * int(k) + 1
else:
	salida = 2 * int(k) + 2
print(salida)


from math import *
n = int(input())
x = sqrt(n)
print(ceil(x + x))


n = int(input())
minimum = 0
maximum = 100000
while maximum > minimum + 1:
	middle = (minimum + maximum) // 2
	if middle % 2 == 0:
		square = (middle / 2) ** 2
	else:
		square = (middle - 1) * (middle + 1) / 4
	if square >= n:
		maximum = middle
	else:
		minimum = middle
print(maximum)


from math import sqrt
numOfSq = sqrt(int(input()))
if int(numOfSq) == numOfSq:
	print(int(numOfSq * 2))
else:
	print(int(numOfSq * 2 + 1))


import math

class CodeforcesTask1099BSolution:

	def __init__(self):
		self.result = ''
		self.n = 0

	def read_input(self):
		self.n = int(input())

	def process_task(self):
		first = self.n / math.ceil(math.sqrt(self.n)) ** 2
		second = math.ceil(math.sqrt(self.n))
		self.result = str(math.ceil(first * second + second))

	def get_result(self):
		return self.result
Solution = CodeforcesTask1099BSolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


import math
No_Square = int(input())
Rooti = 0.0
Root = math.sqrt(No_Square)
Rooti = math.ceil(math.sqrt(No_Square))
No_Line = int(Rooti) + math.ceil(No_Square / Rooti)
print(int(No_Line))


import math
n = int(input())
t = math.sqrt(n)
t1 = round(t)
if t1 < t:
	print(int(t1) * 2 + 1)
else:
	print(int(t1) * 2)


import math
n = int(input())
s = math.sqrt(n)
ceil_s = math.ceil(s)
floor_s = int(s // 1)
(ceil, floor) = (ceil_s ** 2, floor_s ** 2)
if ceil_s != floor_s:
	avg = (ceil + floor) // 2
	if n <= avg:
		print(2 * floor_s + 1)
	elif n > avg:
		print(2 * floor_s + 2)
else:
	print(2 * ceil_s)


from math import sqrt, ceil
num = input()
num = int(num)
print(ceil(sqrt(num) * 2))


from math import sqrt
n = int(input())
p = int(sqrt(n))
if p * p < n:
	p += 1
q = p
while p * q > n:
	q = q - 1
if p * q < n:
	q += 1
print(p + q)


while True:
	n = int(input())
	sqrt_n = int(n ** 0.5)
	minn = 100000000
	if sqrt_n * sqrt_n >= n:
		minn = min(minn, sqrt_n + sqrt_n)
	if sqrt_n * (sqrt_n + 1) >= n:
		minn = min(minn, sqrt_n + (sqrt_n + 1))
	if (1 + sqrt_n) * (1 + sqrt_n) >= n:
		minn = min(minn, 1 + sqrt_n + (1 + sqrt_n))
	print(minn)
	break


import math

def solve(n):
	if int(math.sqrt(n)) * int(math.sqrt(n)) == n:
		print(2 * int(math.sqrt(n)))
	else:
		num = int(math.sqrt(n))
		sq = num
		num = sq * sq
		if n - num <= sq:
			print(2 * sq + 1)
		else:
			sq += 1
			print(2 * sq)

def inp():
	return int(input())
n = inp()
solve(n)


from math import sqrt, ceil

def main():
	n = float(input())
	x = ceil(sqrt(n))
	y = ceil(n / x)
	print(x + y)
main()


import sys
import math
import itertools
import collections

def getdict(n):
	d = {}
	if type(n) is list or type(n) is str:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ''.join(map(str, arr))

def revn(n):
	return int(str(n)[::-1])

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def nconv(number, base=3):
	newnumber = ''
	while number > 0:
		newnumber = str(number % base) + newnumber
		number //= base
	return newnumber
n = ii()
print(math.ceil(math.sqrt(n)) + math.ceil(n / math.ceil(math.sqrt(n))))


def main():
	x = int(input())
	test = int(x ** 0.5)
	if test ** 2 >= x:
		print(2 * test)
	elif test * (test + 1) >= x:
		print(2 * test + 1)
	else:
		print(2 * test + 2)
main()


from math import sqrt, ceil
N = int(input())
ans = int(ceil(sqrt(4 * N)))
print(ans)


def isqrt(n):
	x = n
	y = (x + 1) // 2
	while y < x:
		x = y
		y = (x + n // x) // 2
	return x
n = int(input())
s = isqrt(n)
if s * s == n:
	print(2 * s)
else:
	remainder = n - s * s
	if remainder <= s:
		print(2 * s + 1)
	else:
		print(2 * s + 2)


n = int(input())
if n == 1:
	print(2)
elif n == 2:
	print(3)
else:
	k = int(n ** 0.5)
	rulers = 2 * k
	remain = n - k ** 2
	if remain > k:
		rulers += 2
	elif remain == 0:
		pass
	else:
		rulers += 1
	print(rulers)


x = int(input())
t = int(x ** (1 / 2))
if x == 1:
	print(2)
elif t ** 2 == x:
	print(int(2 * x ** (1 / 2)))
elif t ** 2 + t < x:
	print(2 * int(x ** (1 / 2)) + 2)
else:
	print(2 * int(x ** (1 / 2)) + 1)


n = int(input())
start = 2
c = 0
count = 1
sum = 0
for i in range(n):
	if c == 2:
		c = 0
		count += 1
	c += 1
	sum += count
	if sum >= n:
		print(start)
		break
	start += 1


t = int(input())
l = int(t ** 0.5)
if l == t ** 0.5:
	print(2 * l)
elif abs(l ** 2 - t) < (l + 1) ** 2 - t:
	print(2 * l + 1)
else:
	print(2 * (l + 1))


a = int(input())
b = a ** 0.5
if b % 1 == 0:
	print(int(b + b))
else:
	b = (b + 1) // 1
	c = (a + b - 1) // b
	print(int(b + c))


from math import sqrt
n = int(input())
m = int(sqrt(n))
if n == m * m:
	print(2 * m)
elif n > m * m and n <= m * (m + 1):
	print(2 * m + 1)
else:
	print(2 * m + 2)


import math

def modi(a, m):
	return pow(a, m - 2, m)
n = int(input())
val = int(math.sqrt(n))
if val ** 2 == n:
	print(2 * val)
elif val ** 2 + val >= n:
	print(2 * val + 1)
else:
	print(2 * val + 2)


import math
N = int(input())
i = 0
while (i + 1) * (i + 1) <= N:
	i += 1
print(i + math.ceil(N / i))


n = int(input())
d = 1
while d * d <= n:
	d += 1
d -= 1
if d * d == n:
	ans = d + d
elif d * d + d >= n:
	ans = d + d + 1
else:
	ans = d + d + 2
print(ans)


import math
x = eval(input())
y = math.sqrt(x)
if y % 1 == 0:
	y = y
elif y % 1 >= 0.5:
	y = y // 1 + 1
else:
	y = y // 1 + 0.5
print(int(2 * y))


n = int(input())
temp = int(n ** 0.5)
if temp * temp == n:
	print(2 * temp)
elif n - temp * temp <= temp:
	print(2 * temp + 1)
else:
	print(2 * temp + 2)


import math as mt
import bisect as bi
import collections as cc
I = lambda : list(map(int, input().split()))
(n,) = I()
d = int(n ** 0.5) ** 2
if n == 1:
	print(2)
elif n == 2:
	print(3)
elif n == 3:
	print(4)
elif n - d == 0:
	print(int(n ** 0.5) * 2)
else:
	x = int(n ** 0.5) * 2
	if n <= int(n ** 0.5) ** 2 + int(n ** 0.5):
		print(x + 1)
	else:
		print(x + 2)


n = int(input())
a = int(n ** 0.5)
b = int(n ** 0.5)
fl = False
while a * b < n:
	if fl == False:
		a += 1
		fl = True
	else:
		b += 1
		fl = False
print(a + b)


import math

def isPerfectSquare(x):
	sr = math.sqrt(x)
	return sr - math.floor(sr) == 0
n = int(input())
if n == 1:
	print(2)
elif n == 2:
	print(3)
else:
	a = math.sqrt(n)
	if isPerfectSquare(n):
		print(int(a) * 2)
	else:
		a = int(a) + 1
		k = pow(a, 2)
		m = k - n
		if m < a:
			print(2 * a)
		else:
			print(2 * a - 1)


import math
x = int(input())
print(math.ceil(x ** 0.5 * 2))


import math
n = int(input())
res = []
sqrt = int(math.sqrt(n))
if sqrt * sqrt >= n:
	print(sqrt * 2)
elif (sqrt + 1) * sqrt >= n:
	print(sqrt * 2 + 1)
elif (sqrt + 1) * (sqrt + 1) >= n:
	print(sqrt * 2 + 2)


from math import sqrt

def solve(n):
	x = int(sqrt(n))
	resto = n - x ** 2
	res = 2 * x + resto // x + (1 if resto % x > 0 else 0)
	print(res)
solve(int(input()))


i = int(input())
a = int(pow(i, 0.5))
if i % a == 0:
	print(int(a + i / a))
else:
	print(int(a + i / a + 1))


import math
n = int(input())
x = math.ceil(n ** (1 / 2))
y = math.floor(n ** (1 / 2))
if x * y >= n:
	res = x + y
else:
	res = x + y + 1
print(res)


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 998244353
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
n = Int()
sq = sqrt(n)
ans = int(sq)
extra = n - ans ** 2
if extra > ans:
	extra = 2
elif extra:
	extra = 1
print(ans + ans + extra)


import math
n = int(input())
s = int(n ** 0.5)
a = s
b = s
ost = n - s ** 2
b += math.ceil(ost / a)
print(a + b)


prime = 998244353
t = 1
from math import sqrt
for test in range(t):
	n = int(input())
	tmp = int(sqrt(n) + 1)
	if pow(tmp - 1, 2) >= n:
		tmp -= 1
	if tmp * (tmp - 1) >= n:
		print(2 * tmp - 1)
	else:
		print(2 * tmp)


import math
num = int(input())
k = math.floor(math.sqrt(num))
if math.pow(k, 2) == num:
	print(k * 2)
else:
	num = num - math.pow(k, 2)
	check = math.ceil(num / k)
	print(check + k * 2)


n = int(input())
i = int(n ** 0.5)
k = (n + i - 1) // i
print(i + k)


n = int(input())
i = 1
while i ** 2 < n:
	i += 1
if i ** 2 == n:
	print(2 * i)
else:
	res = (i - 1) ** 2
	val = i ** 2 - 1 - res
	val //= 2
	if n <= val + res:
		print(2 * (i - 1) + 1)
	else:
		print(2 * i)


n = int(input())
ans = 10 ** 10
for i in range(1, 100100):
	x = (n + i - 1) // i
	ans = min(x + i, ans)
print(ans)


from math import sqrt
n = int(input())
l = 1
r = 1
while (l + r) / 2 < sqrt(n):
	if (l + r) % 2 == 0:
		r += 1
	else:
		l += 1
print(r + l)


def roundSqrt(x):
	return int(x ** 0.5)
n = int(input())
s = roundSqrt(n)
if s * s == n:
	print(s * 2)
elif s * (s + 1) >= n:
	print(2 * s + 1)
else:
	print(2 * s + 2)


import math
nn = int(input())
a = int(math.sqrt(nn))
b = math.ceil(nn / a)
print(a + b)


from math import sqrt, ceil

def match(n):
	m1 = ceil(sqrt(n))
	m2 = ceil(n / m1)
	return m1 + m2
print(match(int(input().strip())))


import math
n = int(input())
temp = math.sqrt(n)
if temp % 1 != 0:
	temp = int(temp) + 1
area = temp * temp
ans = temp + temp
pro = (area - n) // temp
print(int(ans - pro))


N = int(input())
sq = int(N ** 0.5)
if N == sq ** 2:
	print(sq * 2)
elif sq + sq ** 2 >= N:
	print(2 * sq + 1)
else:
	print(2 * sq + 2)


import math

def sqrt_round_up(n):
	s = int(math.sqrt(n))
	for ss in range(max(0, s - 5), s + 5):
		if ss * ss >= n:
			return ss
	else:
		assert False
n = int(input())
s = sqrt_round_up(n)
if s * (s - 1) >= n:
	print(2 * s - 1)
else:
	print(2 * s)


from sys import stdin
import math
n = int(stdin.readline().strip())
root = int(math.sqrt(n))
if root ** 2 == n:
	print(2 * root)
	exit()
else:
	t = root * 2
	count = root ** 2
	if n - count <= root:
		t += 1
	elif n - count > root and n - count <= 2 * root + 1:
		t += 2
	print(t)
	exit()


import math
n = int(input())
k = int(n ** 0.5)
print(2 * k + (n - k ** 2 != 0) + (n - k ** 2 > k))


import sys
inf = float('inf')
mod = 1000000007

def fast_io():
	sys.stdin = stream(sys.stdin.read())
	sys.stdout = stream()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline()

def right(n):
	if n == 1:
		print(2)
		return
	ans = inf
	from math import ceil
	for i in range(1, n + 1):
		x = ceil(n / i) + i
		ans = min(ans, x)
	return ans

def main():
	n = int(input())
	if n == 1:
		print(2)
		return
	from math import sqrt, ceil, floor
	p = int(sqrt(n))
	i = p
	ans = p
	ans += 1
	while i < n:
		ans += 1
		i += p
	print(ans)
main()


import math
c = int(input())
b = int(math.sqrt(c))
if c == b * b:
	print(2 * b)
elif c <= b * (b + 1):
	print(b + b + 1)
else:
	print(b + b + 2)


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

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

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 pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	n = I()
	r = inf
	for i in range(1, int(n ** 0.5 + 10)):
		t = (n + i - 1) // i + i
		if r > t:
			r = t
	return r
print(main())


import math
n = int(input())
sum = int(math.sqrt(n))
s2 = n // sum
if n % sum:
	s2 += 1
print(sum + s2)


n = int(input())
for i in range(n, 0, -1):
	x = i ** 0.5
	if x == int(x):
		x = int(x)
		break
n -= x * x
t = 2 * x
if n > 0:
	if n > x:
		t += 2
	else:
		t += 1
print(t)


import math

def rli():
	return list(map(int, input().split()))

def main():
	n = int(input())
	nn = int(math.sqrt(n))
	if nn * nn >= n:
		print(nn + nn)
	elif nn * (nn + 1) >= n:
		print(nn + nn + 1)
	else:
		print(nn + nn + 2)
main()


import sys
import math

def getAndParseInt(num=1):
	string = sys.stdin.readline().strip()
	if num == 1:
		return int(string)
	else:
		return [int(part) for part in string.split()]

def getAndParseString(num=1, delim=' '):
	string = sys.stdin.readline().strip()
	if num == 1:
		return string
	else:
		return [part for part in string.split(delim)]
n = getAndParseInt()
upper = min(n, 100000)
minimum = n + 1
for num in reversed(range(1, upper + 1)):
	dividend = math.ceil(n / num)
	minimum = min(dividend + num, minimum)
print(minimum)


import math
n = int(input())
nn = int(math.sqrt(n))
base = 2 * nn
b2 = n - nn * nn
b2 = math.ceil(b2 / nn)
print(base + b2)


from math import sqrt
n = int(input())
base = int(sqrt(n))
if base ** 2 < n:
	base += 1
print(base + (n + base - 1) // base)