#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long x, y, z, mx = 0, mn = 999999999999999;
  cin >> n;
  for (long long a = 1; a * a * a <= n; ++a)
    if (n % a == 0) {
      for (long long b = a; b * b <= n / a; ++b)
        if ((n / a) % b == 0) {
          long long c = n / a / b;
          x = (a + 1) * (b + 2) * (c + 2) - n;
          y = (a + 2) * (b + 1) * (c + 2) - n;
          z = (a + 2) * (b + 2) * (c + 1) - n;
          if (mn > min(x, min(y, z))) mn = min(x, min(y, z));
          if (mx < max(x, max(y, z))) mx = max(x, max(y, z));
        }
    }
  cout << mn << " " << mx << endl;
  return 0;
}
