#include <bits/stdc++.h>
using namespace std;
long long LLMAX = 9223372036854775807LL;
const int MOD = 1000000007;
const int maxn = 1000 + 10;
unsigned long long n;
int main() {
  cin >> n;
  if (n % 3) {
    puts("0");
    return 0;
  }
  n /= 3;
  vector<unsigned long long> fac;
  for (unsigned long long i = 2; i * i <= n; ++i)
    if (n % i == 0) fac.push_back(i);
  unsigned long long ans = 0;
  for (int(i) = 0; (i) < (int)(fac.size()); ++(i)) {
    unsigned long long d = n / fac[i];
    for (int j = fac.size() - 1; j >= 0; --j) {
      if (d % fac[j] != 0) continue;
      unsigned long long p = d / fac[j];
      if (fac[j] + fac[i] <= p) break;
      if ((fac[i] + fac[j] + p) % 2 == 0 && p + fac[i] > fac[j] &&
          p + fac[j] > fac[i])
        ans++;
    }
  }
  cout << ans << endl;
}
