#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int n, i, j, k, ans, sum, a, b, c, iM, jM;
  while (scanf("%I64d", &n) == 1) {
    if (!(n % 3)) {
      ans = 0;
      n /= 3;
      iM = (long long int)(pow(n, 1.0 / 3.0) + 0.5);
      for (i = 2; i <= iM; i++) {
        if (n % i) continue;
        jM = (long long int)(pow(n / i, 1.0 / 2.0) + 0.5);
        for (j = jM; j >= i; j--) {
          if (n % j) continue;
          k = (n / i) / j;
          if (i + j - k < 0) break;
          if (i * j * k == n) {
            sum = i + j + k;
            if (sum % 2) continue;
            sum /= 2;
            a = sum - i;
            b = sum - j;
            c = sum - k;
            if (a <= 0 || b <= 0 || c <= 0) continue;
            if (a == b && b == c)
              ans++;
            else {
              if (a == b || b == c || a == c)
                ans += 3;
              else
                ans += 6;
            }
          }
        }
      }
      printf("%I64d\n", ans);
    } else
      puts("0");
  }
  return 0;
}
