#include #include #include using namespace std; int main(){ long long n; cin >> n; long long minans = n, maxans; maxans = n - 1; for(long long i = 1; i * i * i <= n; i++) { if(n % i != 0) continue; long long t = n / i; for(long long j = 1; j * j <= t; j++){ if(t % j != 0) continue; long long c; c = t / j; minans = min(minans, i - 1 + j - 1 + c - 1); } } cout << minans << " " << maxans << endl; return 0; }