import java.util.*; public class Main { private static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws Exception { int n = sc.nextInt(); int max = n-1; int min = Integer.MAX_VALUE; int a = 0; for (int i = 1;i < Math.cbrt(n);i++) { if (n%i==0) a = Math.max(a, i); } for (int 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); } }