#include <cmath> #include <algorithm> using namespace std; int main() { int n; long long a[3]; long long Min = 9999999999999999, Max = 0; scanf("%d",&n); long long x = pow(n, 1.0/3); for(int i = 1; i <= x; i++) { int p = n; if(p % i == 0) { p /= i; a[0] = i; int k = sqrt(p); for(int j = 1; j <= k; j++){ if(p % j == 0) { a[1] = j; a[2] = p/a[1]; //printf("%lld %lld %lld\n", a[0], a[1], a[2]); Min = min(Min,(a[0]+1)*(a[1]+2)*(a[2]+2)); Min = min(Min,(a[1]+1)*(a[0]+2)*(a[2]+2)); Min = min(Min,(a[2]+1)*(a[1]+2)*(a[0]+2)); Max = max(Max,(a[0]+1)*(a[1]+2)*(a[2]+2)); Max = max(Max,(a[1]+1)*(a[0]+2)*(a[2]+2)); Max = max(Max,(a[2]+1)*(a[1]+2)*(a[0]+2)); } } } } printf("%lld %lld\n", Min - n, Max - n); return 0; }