#include <bits/stdc++.h>
using namespace std;
long long A[1 << 20];
long long f(long long n) {
  if (n % 3 != 0) return 0;
  int i, j;
  n /= 3;
  long long res = 0;
  long long c;
  int cnt = 0;
  for (c = 2; c * c < n; ++c)
    if (n % c == 0) {
      A[cnt] = c;
      ++cnt;
    }
  for (i = (0); i < (cnt); ++i)
    for (j = (0); j < (i + 1); ++j) {
      long long r = 0;
      long long ab = A[i];
      long long ac = A[j];
      long long bc = ab - ac;
      long long t = (ab + ac) * (ab + ac) - bc * bc;
      if ((4 * n) % t == 0) {
        bc = 4 * n / t;
        long long d = (ab + bc + ac);
        if (d % 2 != 0) continue;
        d /= 2;
        long long a = d - bc;
        long long b = d - ac;
        long long c = d - ab;
        if (a <= 0 || b <= 0 || c <= 0) continue;
        if (d * d * d - a * a * a - b * b * b - c * c * c == 3 * n) ++r;
      }
      res += r;
      if (i != j) res += r;
    }
  return res;
}
int main() {
  long long n;
  scanf("%lld", &n);
  printf("%lld\n", f(n));
  return 0;
};
