#include <bits/stdc++.h>
using namespace std;
vector<bool> tagPrime;
vector<int> prime;
void initPrime(int n) {
  tagPrime = vector<bool>(n + 1);
  tagPrime[0] = tagPrime[1] = true;
  prime.clear();
  for (int i = 2; i <= n; i++) {
    if (tagPrime[i]) continue;
    prime.push_back(i);
    if (i > n / i) continue;
    for (int j = i * i; j <= n; j += i) {
      tagPrime[j] = true;
    }
  }
}
long long n, res;
vector<long long> primeFactor;
vector<int> cnt;
void dfs(int depth, long long x, long long y) {
  if (depth == ((int)(cnt).size())) {
    long long z = n / x / y;
    res += x + y > z && x + z > y && y + z > x;
    return;
  }
  vector<long long> pow(cnt[depth] + 1);
  pow[0] = 1;
  for (int i = (0); i < (cnt[depth]); i++)
    pow[i + 1] = pow[i] * primeFactor[depth];
  if (primeFactor[depth] == 2) {
    dfs(depth + 1, x * pow[cnt[depth]], y);
    dfs(depth + 1, x, y * pow[cnt[depth]]);
    dfs(depth + 1, x, y);
    if (cnt[depth] < 3) return;
    x <<= 1;
    y <<= 1;
    cnt[depth] -= 3;
  }
  for (int i = (0); i < (cnt[depth] + 1); i++) {
    for (int j = (0); j < (cnt[depth] - i + 1); j++) {
      dfs(depth + 1, x * pow[i], y * pow[j]);
    }
  }
}
int main() {
  initPrime(10000000);
  cin >> n;
  if (n % 3) {
    cout << 0 << endl;
  } else {
    n /= 3;
    long long tmp = n;
    for (typeof((prime).begin()) it = (prime).begin(); it != (prime).end();
         it++) {
      if (*it > tmp / *it) break;
      if (tmp % *it) continue;
      primeFactor.push_back(*it);
      cnt.push_back(1);
      for (tmp /= *it; !(tmp % *it); tmp /= *it, cnt.back()++)
        ;
    }
    if (tmp > 1) {
      primeFactor.push_back(tmp);
      cnt.push_back(1);
    }
    if (primeFactor.front() == 2) {
      dfs(0, 1, 1);
    }
    cout << res << endl;
  }
  return 0;
}
