import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np N = int(read()) N = 97772875200 x = np.arange(1, 320000, dtype=np.int64) div = x[N % x == 0] x, y = np.meshgrid(div, div) z, r = np.divmod(N, x * y) ind = r == 0 T = (x + y + z - 3)[ind] print(T.min(), T.max())