#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 = 1; a * a <= n; a++) { if (n % a == 0) { long long b = n / a; x = min(x, a + b - 2); } } for (long long a = 1; a * a * a <= n; a++) { if (n % a == 0) { long long m = n / a; for (long long b = a; b * b <= m; b++) { if (m % b == 0) { long long c = m / b; x = min(x, a + b + c - 3); } } } } cout << x << " " << y << endl; return 0; }