import java.util.*; public class Main { private static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws Exception { long n = sc.nextLong(); long max = n-1; long min = n; int l = (int) Math.cbrt(n); int a = 0; for (int i = l;i >= 0;i--) { if (n%i==0) { a = i; break; } } int d = (int)(n/(long)a); for (int i = d-1;i > 0;i--) { if (d%i==0) { min = Math.min(min, a+i+d/i-3); } } System.out.println(min + " " + max); } }