#include #include #include int main() { long long n; std::cin >> n; long long max = n - 1, min = n - 1; long long a, b, c, end, end2; end2 = std::pow(n, 0.33333333333333) + 1; for (long long i = 1; i <= end2; i++) { if (n % i != 0) continue; long long tn = n / i; end = sqrt(tn); for (long long j = i; j <= end; j++) { if (tn % j != 0) continue; min = std::min(min, i + j + tn / j - 3); } } std::cout << min << " " << max << std::endl; return 0; }