import java.util.*; public class Main { private static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws Exception { long n = sc.nextLong(); long max = n-1; long min = Long.MAX_VALUE; for (long i = 1;i <= (long) Math.cbrt(n);i++) { if (n%i==0) { for (long j = 1;j <= (long) Math.sqrt(n/i);j++) { if ((n/i)%j==0) { min = Math.min(min,i+(n/i)/j+j); } } } } System.out.println((min-3)+" "+max); } }