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 Sqn = (long)Math.Sqrt(N)+1; for(long i = Sqn; i >= 1; i--) { long n = N; if (n % i == 0) { n /= i; long sqn = (long)Math.Sqrt(n); for(long j = sqn; j >= 1; j--) { long nn = n; if (n % j == 0) { nn /= j; min = Math.Min(min, i + j + nn - 3); } } } } Console.WriteLine(min + " " + Max); } }