import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = sc.nextLong(); long M = (long)Math.cbrt(N); long Tmax = N-1; long Tmin = Tmax; for(long i=1; i<=M; i++){ long a=N; if(a%i==0){ long m = (long)Math.sqrt(a/i); for(long j=i; j<=m; j++){ long b = a/i; if(b%j==0){ long c = b/j; Tmin = Math.min(Tmin,i+j+c-3); } } } } System.out.println(Tmin+" "+Tmax); } }