#include <bits/stdc++.h>
using namespace std;
long long n, pn;
long long ans;
long long p[10000010];
int main() {
  scanf("%I64d", &n);
  if (n % 3) {
    puts("0");
    return 0;
  }
  n /= 3;
  pn = 0;
  for (long long i = 2; i * i <= n; i++)
    if (n % i == 0) p[++pn] = i;
  ans = 0;
  for (long long i = 1; i <= pn && p[i] * p[i] * p[i] <= n; i++) {
    long long m = n / p[i];
    for (long long j = i; j <= pn && p[j] * p[j] <= m; j++) {
      if (m % p[j]) continue;
      long long k = m / p[j];
      if (k < p[j]) continue;
      if ((p[i] + p[j] + k) & 1) continue;
      if (p[i] + p[j] <= k) continue;
      int add = 6;
      if (p[i] == p[j] && p[j] == k)
        add = 1;
      else if (p[i] == p[j] || p[j] == k || p[i] == k)
        add = 3;
      ans += add;
    }
  }
  printf("%I64d\n", ans);
}
