import java.util.*; public class Main { static HashMap map = new HashMap<>(); public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long max = n; for (long i = 2; i <= Math.sqrt(n); i++) { while (n % i == 0) { map.put(i, map.getOrDefault(i, 0) + 1); n /= i; } } if (n > 1) { map.put(n, map.getOrDefault(n, 0) + 1); } HashSet prev = new HashSet<>(); prev.add(new Unit(1, 1, 1)); for (long x : map.keySet()) { HashSet tmp = new HashSet<>(); for (int i = 0; i <= map.get(x); i++) { for (int j = 0; j <= map.get(x) - i; j++) { tmp.add(new Unit(i, j, map.get(x) - i - j, x)); } } HashSet current = new HashSet<>(); for (Unit u1 : prev) { for (Unit u2 : tmp) { current.addAll(u1.add(u2)); } } prev = current; } long min = max; for (Unit u : prev) { min = Math.min(min, u.getSum()); } System.out.println(min + " " + (max - 1)); } static class Unit { long[] arr = new long[3]; public Unit(long a, long b, long c) { arr[0] = a; arr[1] = b; arr[2] = c; Arrays.sort(arr); } public Unit(int a, int b, int c, long x) { this(pow(x, a), pow(x, b), pow(x, c)); } public HashSet add(Unit another) { HashSet ret = new HashSet<>(); int[][] perm = new int[][]{{0, 1, 2}, {0, 2, 1}, {1, 0, 2}, {1, 2, 0}, {2, 0, 1}, {2, 1, 0}}; for (int[] zz : perm) { ret.add(new Unit(arr[0] * another.arr[zz[0]], arr[1] * another.arr[zz[1]], arr[2] * another.arr[zz[2]])); } return ret; } public int hashCode() { return 0; } public boolean equals(Object o) { Unit u = (Unit) o; for (int i = 0; i < 3; i++) { if (arr[i] != u.arr[i]) { return false; } } return true; } public long getSum() { long sum = 0; for (long x : arr) { sum += x - 1; } return sum; } public String toString() { return arr[0] + ":" + arr[1] + ":" + arr[2]; } } static long pow(long x, int p) { if (p == 0) { return 1; } else if (p % 2 == 0) { return pow(x * x, p / 2); } else { return x * pow(x, p - 1); } } }