n = int(input()) l = int(n**(1/2)) y = [i for i in range(1,l+1) if n%i == 0] x = [n//i for i in y] m = float('inf') for (a,b) in [(i,j) for i in y if i**3 <=n for j in y+x \ if j >= i and n%(i*j) == 0 and i*j*j <= n]: m = min(a+b+n//(a*b)-3, m) print(m,n-1)