@staticmethod
def b():
    n = int(sys.stdin.readline().rstrip())
    res = inf
    for i in range(1, (int((n ** 0.5)) + 1)):
        res = min(res, (((n // i) - i) + (n % i)))
    print(res)
@staticmethod
def b():
    n = int(sys.stdin.readline().rstrip())
    res = inf
    for i in range(1, (int((n ** 0.5)) + 1)):
        res = min(res, (((n // i) - i) + (n % i)))
    print(res)