#include <bits/stdc++.h>
using namespace std;
long long int mod_expo(long long int MOD, long long int a, long long int b) {
  long long int ans = 1;
  while (b) {
    if (b % 2) {
      ans *= a;
      ans %= MOD;
    }
    b /= 2;
    a *= a;
    a %= MOD;
  }
  return ans % MOD;
}
void display(vector<int> v1) {
  for (int i = 0; i < v1.size(); i++) {
    cout << v1[i] << " ";
  }
  cout << endl;
}
int dx[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int dy[8] = {1, 0, -1, 0, 1, -1, 1, -1};
using namespace std;
long long int n;
void computemin() {
  long long int ans = (long long int)1e18;
  for (long long int i = 1; i <= sqrt(n); i += 1) {
    if (n % i == 0) {
      long long int firsty = i;
      long long int second = n / i;
      for (long long int j = 1; j <= sqrt(second); j += 1) {
        if (second % j == 0) {
          long long int newone = (firsty + 1) * (j + 2) * ((second / j) + 2);
          ans = min(ans, newone - n);
        }
      }
    }
  }
  cout << ans << " ";
}
void computemax() {
  long long int orig = (n + 1) * 3LL * 3LL;
  cout << orig - n << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  computemin();
  computemax();
  return 0;
}
