import java.util.*; public class Main_yukicoder375 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); List divisors = new ArrayList<>(); for (long i = 1; i * i <= n; i++) { if (n % i == 0) { divisors.add(i); if (i != n / i) { divisors.add(n / i); } } } Collections.sort(divisors); long min = n - 1; long max = n - 1; for (int i = 0; i < divisors.size(); i++) { long x = divisors.get(i); if (x * x * x > n) { break; } for (int j = i; j < divisors.size(); j++) { long y = divisors.get(j); if (x * y * y > n) { break; } if (n % (x * y) != 0) { continue; } long z = n / (x * y); min = Math.min(min, (x - 1) + (y - 1) + (z - 1)); } } System.out.printf("%d %d\n", min, max); sc.close(); } }