#include <bits/stdc++.h>
using namespace std;
long long N;
vector<long long> dvs;
void prep();
void soups_on();
int main() {
  cin >> N;
  if (N % 3)
    cout << "0\n";
  else {
    N /= 3;
    prep();
    soups_on();
  }
  return 0;
}
void prep() {
  for (long long i = 1; i * i <= N; ++i)
    if (N % i == 0) dvs.push_back(i);
}
void soups_on() {
  long long k1, k2, k3, sum, hlf;
  int res = 0;
  for (int i = 0; i < int(dvs.size()) && dvs[i] * dvs[i] * dvs[i] <= N; ++i)
    for (int j = i; j < int(dvs.size()) && dvs[i] * dvs[j] * dvs[j] <= N; ++j)
      if (N % (dvs[i] * dvs[j]) == 0) {
        k1 = dvs[i], k2 = dvs[j], k3 = N / (dvs[i] * dvs[j]);
        sum = k1 + k2 + k3, hlf = sum / 2;
        if (sum % 2 == 0 && (k1 < hlf && k2 < hlf && k3 < hlf)) {
          if (k1 != k2 && k2 != k3) res += 6;
          if (k1 != k2 && k2 == k3) res += 3;
          if (k1 == k2 && k2 != k3) res += 3;
          if (k1 == k2 && k2 == k3) res += 1;
        }
      }
  cout << res << "\n";
}
