#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  if (n % 3) {
    cout << "0";
    return 0;
  } else
    n /= 3;
  int result = 0;
  long long m, k;
  vector<long long> divisors;
  for (long long i = 1; i * i < n; i++)
    if (n % i == 0) divisors.push_back(i);
  long long b;
  for (b = 1; b * b * b <= n; b++)
    ;
  for (int i = 0; divisors[i] < b; i++) {
    for (int j = i; j < divisors.size(); j++) {
      long long x = divisors[i], y = divisors[j];
      long long z = n / (x * y);
      if (y > z || x * y * z != n) continue;
      if ((x + y <= z) || (x + z <= y) || (y + z <= x) || (x + y + z) % 2 == 1)
        continue;
      if (x == y && y == z)
        result++;
      else if (x == y || y == z)
        result += 3;
      else
        result += 6;
    }
  }
  cout << result;
  return 0;
}
