#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> v;
int main() {
  while (~scanf("%I64d", &n)) {
    if (n % 3) {
      printf("0\n");
      continue;
    }
    n /= 3;
    v.clear();
    for (long long i = 1; i * i <= n; i++)
      if (n % i == 0) v.push_back(i);
    long long ans = 0;
    for (int i = 0; i < int(v.size()); i++) {
      long long a = v[i], d = n / a;
      for (int j = int(v.size()) - 1; j >= 0; j--) {
        long long b = v[j];
        if (d % b) continue;
        long long c = d / b;
        if (a + b <= c) break;
        if ((a + b + c) % 2 == 0 && a + c > b && b + c > a) ans++;
      }
    }
    printf("%I64d\n", ans);
  }
  return 0;
}
