#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; if(t == 1){ u = sqrtl(n); while((n % u) != 0){ u--; } minans = u - 1 + (n / u) - 1; }else{ minans = t - 1 + t - 1 + (n / t / t) - 1; } cout << minans << " " << maxans << endl; return 0; }