import math N = int(input()) tmax = N - 1 tmin = float('inf') a_max = int(N ** (1/3)) + 2 # Adding 2 to ensure we cover the cube root for a in range(1, a_max + 1): if N % a != 0: continue M = N // a b_max = int(math.isqrt(M)) for b in range(a, b_max + 1): if M % b != 0: continue c = M // b if b <= c: current_sum = a + b + c if current_sum < tmin: tmin = current_sum # Ensure the minimal case is considered even if all factors are larger than cube root if tmin == float('inf'): tmin = 1 + 1 + N # Fallback to 1,1,N case tmin -= 3 print(tmin, tmax)