#include using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); long long n; cin >> n; long long x = n - 1, y = n - 1; for (long long a = sqrt(n) + 1; a > 1; a--) { if (n % a == 0) { long long b = n / a; x = min(x, a + b - 2); break; } } for (long long a = 1; a * a * a <= n; a++) { if (n % a == 0) { long long m = n / a; for (long long b = sqrt(m) + 1; b > 0; b--) { if (m % b == 0) { long long c = m / b; x = min(x, a + b + c - 3); break; } } } } cout << x << " " << y << endl; return 0; }