#include <bits/stdc++.h>
using namespace std;
long long fac[1000005];
long long solve(long long a, long long b, long long t, long long li) {
  long long c = 0;
  long long delta = (a + b) * (a + b) - 4 * (a * b - t);
  long long sq = (long long)sqrt(delta) * (long long)sqrt(delta);
  if (delta < 0) return 0;
  if (sq != delta) return 0;
  long long up = -(a + b) + sqrt(delta);
  if (up > 0 && up % 2 == 0) c = up / 2;
  if (!c) return 0;
  if (a == b && b == c) return 1;
  if (a == b || b == c || a == c) return 3;
  if (c <= b) return 0;
  return 6;
}
int main() {
  long long n, p = 0, a, b, c, ans = 0;
  scanf("%I64d", &n);
  if (n % 3) {
    printf("0\n");
    return 0;
  }
  n /= 3;
  for (long long i = 1; i * i * i <= n; i++)
    if (n % i == 0) fac[p++] = i;
  for (int i = 0; i < p; i++) {
    for (int j = 1; j + j <= fac[i]; j++) {
      a = j;
      b = fac[i] - j;
      ans += solve(a, b, n / fac[i], fac[i] / 2);
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
