#include <bits/stdc++.h>   #pragma comment(linker,  /STACK:64000000 )   using namespace std;   int main() {     long long n;     cin >> n;     vector<long long> v;     long long mx = -1, mn = -1;     for (long long i = 1; i * i <= n; i++)       if (n % i == 0) {         v.push_back(i);         v.push_back(n / i);       }     sort((v).begin(), (v).end());     for (int i = 0; i < (int)(v).size(); i++) {       long long rest = n / v[i];       for (int j = 0; j < (int)(v).size(); j++)         if (rest % v[j] == 0) {           long long a = v[i] + 1;           long long b = v[j] + 2;           long long c = rest / v[j] + 2;           mx = max(mx, a * b * c - (a - 1) * (b - 2) * (c - 2));           if (mn == -1) mn = a * b * c - (a - 1) * (b - 2) * (c - 2);           mn = min(mn, a * b * c - (a - 1) * (b - 2) * (c - 2));         }     }     cout << mn <<     << mx;     return 0;   }   