#include <bits/stdc++.h>
int main(void) {
  long i;
  long long n, min = 1e18, max = 0, a[2], b, c, d;
  scanf("%I64d", &n);
  for (a[0] = 2; (a[0] - 1) * (a[0] - 1) <= n; a[0]++) {
    if (!(n % (a[0] - 1))) {
      a[1] = n / (a[0] - 1) + 1;
      for (i = 0; i < 2; i++)
        for (b = 3; (b - 2) * (b - 2) <= (n / (a[i] - 1)); b++)
          if (!((n / (a[i] - 1)) % (b - 2))) {
            c = n / ((a[i] - 1) * (b - 2)) + 2;
            d = 2 * a[i] * b + 2 * a[i] * c + b * c - 4 * a[i] - 2 * b - 2 * c +
                4;
            if (min > d) min = d;
            if (max < d) max = d;
          }
    }
  }
  printf("%I64d %I64d\n", min, max);
  return 0;
}
