import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(), m = 1, min = n - 1; if (n == 2) { System.out.println(1 + " " + 1); return; } while (m * m * m < n) { m++; } boolean flg = true; while (flg) { for (long i = m; flg && i >= m / 3; i--) { for (long j = m - i, k = 0; j >= k; j--, k++) { if ((i + 1) * (j + 1) * (k + 1) == n) { min = Math.min(min, i + j + k); flg = false; break; } } } m++; } System.out.println(min + " " + (n - 1)); } }