#include <bits/stdc++.h>
using namespace std;
long n;
int work1() {
  long long ans = -1;
  double k;
  long i, j;
  long p;
  double pi = n;
  for (i = 1; i <= sqrt(pi); i++)
    if (0 == n % i) {
      long tmp = n / i;
      double k = sqrt((double)tmp);
      p = (long)k;
      for (j = p; j > 0; j--)
        if (0 == tmp % j) break;
      long long a = i + 1;
      long long b = j + 2;
      long long c = (n / i / j + 2);
      if ((long long)a * b * c < ans || ans == -1) ans = (long long)a * b * c;
    }
  cout << (long long)(ans - n) << " ";
  return 0;
}
int work2() {
  long long pi = n;
  cout << (long long)((pi + 1) * 3 * 3 - pi) << endl;
  return 0;
}
int main() {
  cin >> n;
  work1();
  work2();
}
