#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
long long n;
int main() {
  long long i, j, k;
  cin >> n;
  if (n % 3) {
    cout << 0;
    return 0;
  }
  n /= 3ll;
  for (i = 2; i * i <= n; ++i)
    if (n % i == 0) v.push_back(i);
  int ans = 0;
  for (i = 0; i < v.size(); ++i) {
    long long d = n / v[i];
    for (j = v.size() - 1; j >= 0; --j) {
      if (d % v[j]) continue;
      long long vv = d / v[j];
      if (v[i] + v[j] <= vv) break;
      if ((v[i] + v[j] + vv) % 2 == 0 && v[i] + vv > v[j] && vv + v[j] > v[i])
        ans++;
    }
  }
  cout << ans;
  return 0;
}
