#include <bits/stdc++.h>
using namespace std;
vector<long long> fac;
void get_fact(long long x) {
  for (long long i = 1; i * i <= x; i++) {
    if (x % i == 0) {
      fac.push_back(i);
    }
  }
}
int main() {
  long long n;
  scanf("%I64d", &n);
  if (n % 3) {
    cout << 0;
    return 0;
  }
  long long r = n / 3;
  get_fact(r);
  long long res = 0;
  for (int i = 0; i < fac.size(); i++)
    for (int j = 0; j < fac.size(); j++) {
      long long a = fac[i], b = fac[j], c = (r / a) / b;
      if (!(r % (a * b)) && !((a + b + c) % 2)) {
        if (a + b > c && a + c > b && b + c > a) {
          res++;
        }
      }
    }
  printf("%I64d\n", res);
}
