#include <bits/stdc++.h>
using namespace std;
long long N;
vector<long long> A;
bool check(long long a, long long b, long long c) {
  if (a + b <= c || a + c <= b || b + c <= a) return 0;
  if ((a + b - c) % 2 == 1 || (b + c - a) % 2 == 1 || (a + c - b) % 2 == 1)
    return 0;
  return 1;
}
int main() {
  scanf("%I64d", &N);
  if (N % 3 != 0) {
    puts("0");
    getchar();
    getchar();
    return 0;
  }
  N /= 3;
  for (long long i = 1; i * i <= N; i++)
    if (N % i == 0) A.push_back(i);
  int ret = 0;
  for (int i = 0; i < A.size(); i++) {
    long long t = N / A[i];
    for (int j = 0; j < A.size(); j++)
      if (t % A[j] == 0)
        if (check(A[i], A[j], t / A[j])) ret++;
  }
  printf("%d\n", ret);
  getchar();
  getchar();
  return 0;
}
