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