#include <bits/stdc++.h>
using namespace std;
void rrr() {}
int main() {
  rrr();
  long long n;
  cin >> n;
  if (n % 3) {
    cout << 0 << endl;
    return 0;
  }
  n /= 3;
  vector<long long> a;
  for (long long i = 1; i * i <= n; ++i)
    if (n % i == 0) {
      a.push_back(i);
      if (i * i != n) a.push_back(n / i);
    }
  sort((a).begin(), (a).end());
  int nm = (a.size() + 1) / 2;
  int res = 0;
  for (int i = (0); i < (nm); ++i) {
    long long t = n / a[i];
    for (int j = (i); j < (nm); ++j) {
      if (t % a[j]) continue;
      long long d = t / a[j];
      if (d < a[j]) break;
      if ((a[i] + a[j] + d) & 1) continue;
      if (a[i] + a[j] > d) {
        if (a[i] == a[j]) {
          if (a[i] == d)
            res += 1;
          else
            res += 3;
        } else {
          if (a[i] == d || a[j] == d)
            res += 3;
          else
            res += 6;
        }
      }
    }
  }
  cout << res << endl;
  return 0;
};
