#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> uoc;
int solve(long long s, long long m, long long a) {
  long long delta = s * s - m * 4;
  if (delta < 0) return 0;
  long long d = sqrt(delta + 0.5);
  if (d * d != delta) return 0;
  if ((s + d) % 2) return 0;
  if (s < d) return 0;
  long long b = (s - d) / 2;
  long long c = (s + d) / 2;
  if (b < a || c < a) return 0;
  if (a == b && a == c) return 1;
  if (a == b || b == c) return 3;
  return 6;
}
int main() {
  cin >> n;
  if (n % 3) {
    cout << 0 << endl;
    return 0;
  }
  n /= 3;
  for (int i = (1); i <= (sqrt(n + 0.5)); i++)
    if (n % i == 0) {
      uoc.push_back(i);
      if (n / i != i) uoc.push_back(n / i);
    }
  int res = 0;
  sort(uoc.begin(), uoc.end());
  for (int i = 0; i < (uoc.size()); i++) {
    long long s = uoc[i];
    if (s * s > n) break;
    for (int j = (1); j <= (50000); j++) {
      long long a = j;
      if (a * 2 > s || a * a * s + a * s * s > n) break;
      long long tmp = a * a * s + a * s * s;
      long long nn = n - tmp;
      if (nn % s) continue;
      long long m = nn / s;
      if (m < 0) continue;
      res += solve(s, m, a);
    }
  }
  cout << res << endl;
  return 0;
}
