#include #include using namespace std; int main(){ long long n; cin >> n; long long minans, maxans; maxans = n - 1; long long t = powl(n, 1.0 / 3); while((n % t) != 0){ t--; } long long u = sqrtl(n / t); while(((n / t) % u) != 0){ u--; } minans = t - 1 + t - 1 + (n / t / u) - 1; cout << minans << " " << maxans << endl; return 0; }