import math n = int(input()) tmax = n - 1 nn = math.ceil(math.sqrt(n)) fac1 = 0 fac2 = 0 ans1 = 10**10 for i in range(nn, 0, -1): if n % i == 0: fac1 = i fac2 = n // fac1 tmin = 0 fac1sq = round(math.sqrt(fac1)) fac2sq = round(math.sqrt(fac2)) if fac1sq ** 2 == fac1: tmin += (fac1sq - 1) * 2 elif fac1 % 2 == 0: tmin += fac1 // 2 else: tmin += fac1 - 1 if fac2sq ** 2 == fac2: tmin += (fac2sq - 1) * 2 elif fac2 % 2 == 0: tmin += fac2 // 2 else: tmin += fac2 - 1 ans1 = min(ans1, tmin) print(ans1, tmax)