n = int(input()) yaku = [i for i in range(1,n+1) if n%i == 0] x = {a+b+n//(a*b)-3 for a in yaku if a**3 <= n for b in yaku if n%(a*b) == 0} print(min(x),n-1)