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; long a = 0; for (long i = 1;i <= Math.cbrt(n);i++) { if (n%i==0) a = Math.max(a, i); } for (long i = 1;i < n/a;i++) { if ((n/a)%i==0) min = Math.min(min,a+(n/a)/i+i); } System.out.println((min-3)+" "+max); } }