using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.Linq; class Magatro { static long N = long.Parse(Console.ReadLine()); static void Main() { long max = N - 1; long min = long.MaxValue; long threeroot = (long)Math.Pow(N, 1.0 / 3)+1; long a=1, b=1, c=N; for(long i = threeroot; i >= 1; i--) { long q = N; if (N % i == 0) { a = i; q = N / i; for(long j = threeroot; j >= 1; j--) { if (q % j == 0) { b = j; c = q / j; } } } } min = (a - 1) + (b - 1) + (c - 1); Console.WriteLine(min + " " + max); } }