import java.util.Arrays; import java.util.LinkedList; import java.util.Scanner; public class Main { public static long MOD = 1000000007; public static void main(String[] args) { Scanner sc = new Scanner(System.in); final long N = sc.nextLong(); long max = N - 1, min = N - 1; for(long i = 1; i * i <= N; i++){ if(N % i != 0){ continue; } final long new_N = (N / i); for(long j = 1; j * j <= new_N; j++){ if(new_N % j != 0){ continue; } final long k = new_N / j; //System.out.println(i + " " + j + " " + k); min = Math.min(min, (i - 1) + (j - 1) + (k - 1)); } } System.out.println(min + " " + max); } }