using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ // (x+1)(y+1)(z+1) == N のもとで、 x+y+zのMax/Min を求める long min = (long)1e12; long max = 0; for(long x=0;x<7000;x++){ if(N%(x+1)!=0)continue; long rem = N/(x+1); for(long y=0;y*y<=rem;y++){ if(rem%(y+1) == 0){ long z = rem/(y+1) -1; min = Math.Min(min,x+y+z); max = Math.Max(max,x+y+z); } } } Console.WriteLine("{0} {1}",min,max); } long N; public Sol(){ N = rl(); } static String rs(){return Console.ReadLine();} static int ri(){return int.Parse(Console.ReadLine());} static long rl(){return long.Parse(Console.ReadLine());} static double rd(){return double.Parse(Console.ReadLine());} static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);} static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));} static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));} static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));} }