import math n = int(input()) s = int(math.sqrt(n)) while s * s < n: s += 1 while s * s > n: s -= 1 ans = 2 * s if n // s == s: ans -= 1 print(ans)