#include <bits/stdc++.h>
long long n;
int ans;
long long x, y, z;
int i, j, k;
long long a[3];
std::list<long long> fac;
std::list<long long>::const_iterator it[2];
int main() {
  scanf("%I64d", &n);
  if (n % 3ll)
    puts("0");
  else {
    n /= 3ll;
    for (x = 2ll; x * x <= n; ++x)
      if (n % x == 0) fac.push_back(x);
    for (it[0] = fac.begin(); it[0] != fac.end(); ++it[0])
      for (it[1] = it[0]; it[1] != fac.end(); ++it[1])
        if (n % (*it[0] * *it[1]) == 0) {
          x = *it[0];
          y = *it[1];
          z = n / (x * y);
          if (z > x || (y + z - x) & 1ll) continue;
          a[0] = (y + z - x) / 2ll;
          a[1] = y - a[0];
          a[2] = z - a[0];
          if (a[0] > 0 && a[1] > 0 && a[2] > 0) {
            std::sort(a, a + 3);
            do ++ans;
            while (std::next_permutation(a, a + 3));
          }
        }
    printf("%d\n", ans);
  }
  return 0;
}
