import math n = int(input()) tmax = n - 1 nn = math.ceil(math.sqrt(n)) fac1 = 0 fac2 = 0 tmin = 0 for i in range(nn, 0, -1): if n % i == 0: fac1 = i fac2 = n // fac1 fac1sq = round(math.sqrt(fac1)) fac2sq = round(math.sqrt(fac2)) print(fac1,fac2) print(fac1sq,fac2sq) 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 print(tmin, tmax)