#include <bits/stdc++.h>
using namespace std;
void Solve();
int main() { Solve(); }
long long n;
int a[10000010], cnt;
inline bool check(int x, int y, int z) {
  if (x + y <= z) return 0;
  if (x + z <= y) return 0;
  if (y + z <= x) return 0;
  return 1;
}
void Solve() {
  cin >> n;
  if (n % 3) {
    cout << 0 << endl;
    return;
  }
  n /= 3;
  int bnd = int(sqrt(n));
  for (int i = 1; i <= bnd; ++i)
    if (n % i == 0) a[++cnt] = i;
  long long ans = 0;
  for (int i = 1; i <= cnt; ++i) {
    long long t = n / a[i];
    for (int j = i; j <= cnt; ++j) {
      long long z = t / a[j];
      if (z * a[j] != t) continue;
      if (z < a[j]) break;
      if (a[i] + a[j] + z & 1) continue;
      if (!check(a[i], a[j], z)) continue;
      if (a[i] == a[j]) {
        if (a[j] == z)
          ++ans;
        else
          ans += 3;
      } else if (a[j] == z)
        ans += 3;
      else
        ans += 6;
    }
  }
  cout << ans << endl;
}
