#include <bits/stdc++.h>   using namespace std;   const long long LINF = ~0ULL >> 1;   const int N = 1e3 + 7;   const int INF = 2e8 + 7;   const int MOD = 1e9 + 7;   const double PI = acos(-1.0);   const double EPS = 1e-8;   int n;   long long calc(long long A, long long B, long long C) {     return (A + 1) * (B + 2) * (C + 2);   }   void solve() {     long long mn = LINF, mx = -LINF, tmp;     for (int i = 1; 1ll * i * i * i <= n; ++i) {       if (n % i) continue;       for (int j = i, J = n / i; 1ll * j * j <= J; ++j) {         if (J % j) continue;         int k = n / i / j;         tmp = calc(i, j, k);         mn = min(mn, tmp), mx = max(mx, tmp);         tmp = calc(j, i, k);         mn = min(mn, tmp), mx = max(mx, tmp);         tmp = calc(k, i, j);         mn = min(mn, tmp), mx = max(mx, tmp);       }     }     cout << mn - n <<     << mx - n << endl;   }   int main() {     std::ios_base::sync_with_stdio(false);     cin >> n;     solve();     return 0;   }   