#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  if (n % 3) {
    cout << 0 << endl;
    return 0;
  }
  n /= 3;
  vector<long long> d;
  for (long long i = 2; i * i <= n; ++i)
    if (n % i == 0) d.push_back(i);
  long long res = 0;
  for (int it = 0; it < d.size(); ++it) {
    long long ab = d[it];
    long long n1 = n / ab;
    for (int it1 = it; it1 < d.size() && n1 / d[it1] >= d[it1]; ++it1)
      if (n1 % d[it1] == 0) {
        long long ac = d[it1];
        long long bc = n1 / ac;
        if ((ab + ac + bc) % 2 == 1 || bc >= ab + ac) continue;
        if (ab == ac && ac == bc) {
          ++res;
        } else if (ab == ac || ac == bc) {
          res += 3;
        } else
          res += 6;
      }
  }
  cout << res << endl;
  return 0;
}
