#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) #define M_PI 3.14159265359 vector insuu; int main() { long long n; cin >> n; long long T_max = n-1; long long now_hoge = 2; long long copy_n = n; while (now_hoge <= sqrt(copy_n)) { if (n%now_hoge == 0) { n /= now_hoge; insuu.push_back(now_hoge); } else { now_hoge++; } } long long a[3] = {1,1,1}; insuu.push_back(n); sort(insuu.begin(), insuu.end()); for (int i = 0;i < insuu.size();++i) { a[i%3] *= insuu[i]; } cout << a[0] + a[1] + a[2] - 3 << " " << T_max << endl; }