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