#include <bits/stdc++.h>
using namespace std;
struct triple {
  long long a, b, c;
  triple() {}
  triple(long long a, long long b, long long c) : a(a), b(b), c(c) {}
};
inline bool operator<(const triple &a, const triple &b) {
  return make_pair(make_pair(a.a, a.b), a.c) <
         make_pair(make_pair(b.a, b.b), b.c);
}
map<triple, bool> was;
inline void solve(long long a, long long b, long long c) {
  vector<int> p(3);
  p[0] = a, p[1] = b, p[2] = c;
  sort((p).begin(), (p).end());
  if (p[0] <= 0) return;
  do {
    was[triple(p[0], p[1], p[2])] = 1;
  } while (next_permutation((p).begin(), (p).end()));
}
int main() {
  long long n;
  while (scanf("%I64d", &n) >= 1) {
    if (n % 3) {
      puts("0");
      continue;
    }
    n /= 3;
    was.clear();
    vector<long long> ds;
    for (long long i = 1; i * i <= n; ++i)
      if (!(n % i)) {
        ds.push_back(i);
        if (i * i != n) ds.push_back(n / i);
      }
    sort((ds).begin(), (ds).end());
    for (int i = 0; i < (int)ds.size() && ds[i] * ds[i] * ds[i] <= n; i++)
      for (int j = i; j < (int)ds.size() && ds[i] * ds[j] * ds[j] <= n; j++) {
        long long x = ds[i], y = ds[j];
        if (n % (x * y)) continue;
        long long z = n / x / y;
        if (z < y || (x + y + z) % 2) continue;
        long long sum = (x + y + z) / 2;
        long long a = sum - z;
        long long b = sum - y;
        long long c = sum - x;
        solve(a, b, c);
      }
    printf("%d\n", (int)was.size());
  }
  return 0;
}
