#include <bits/stdc++.h>
using namespace std;
long long n, ans;
long long Max(long long a1, long long a2) { return a1 > a2 ? a1 : a2; }
int main() {
  while (~scanf("%I64d", &n)) {
    if (n % 3) {
      printf("0\n");
      continue;
    }
    n /= 3;
    ans = 0;
    for (long long i = 2; i * i * i <= n; i++) {
      if (n % i) continue;
      long long ni = n / i;
      long long u2 = (long long)sqrt((long double)ni * 4 + i * i);
      u2 = Max(i, (u2 - i) / 2);
      for (long long j = u2; j * j <= ni; j++) {
        if (ni % j) continue;
        long long k = ni / j;
        if (k < j) continue;
        if ((i + j + k) % 2) continue;
        if ((i + j) <= k) continue;
        if (i == k)
          ans++;
        else if (i == j || j == k)
          ans += 3;
        else
          ans += 6;
      }
    }
    printf("%I64d\n", ans);
  }
  return 0;
}
