#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define MAX_MOD 1000000007 #define REP(i,n) for(int i = 0;i < n;++i) int main(){ long long n; cin >> n; long long T_max = n - 1; long long hoge = pow(n, 3.0); long long wow = 1000000000000; for (long long i = hoge;i >= 1;--i) { if (n%i == 0) { long long pre_ans = i; for (int q = 1;q <= sqrt(n / i) + 1;++q) { if ((n / i) % q == 0) { wow = min(wow, pre_ans + q + (n / i) / q); } } } } cout << wow-3 << " " << T_max << endl; return 0; }