import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np N = int(read()) x = np.arange(1, 10**7, dtype=np.int64) div = x[N % x == 0] def solve_fixed_x(x): M = N // x y = div[M % div == 0] z = M // y T = (x + y + z - 3) return T.min(), T.max() INF = 10 ** 18 answer = [INF, -INF] for x in div.tolist(): a, b = solve_fixed_x(x) if answer[0] > a: answer[0] = a if answer[1] < b: answer[1] = b print(*answer)