#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> all;
int res;
void solve(long long x, long long y, long long z) {
  long long sum = x + y + z;
  if (sum % 2) return;
  sum /= 2;
  long long xx = sum - x;
  long long yy = sum - y;
  long long zz = sum - z;
  if (xx < 1 || yy < 1 || zz < 1) return;
  if (xx == yy && xx == zz)
    res++;
  else if (xx == yy || xx == zz || yy == zz)
    res += 3;
  else
    res += 6;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  if (n % 3) {
    cout << 0;
    exit(0);
  }
  n /= 3;
  for (int i = 2; i <= sqrt(n); i++)
    if (n % i == 0) all.push_back(i);
  for (auto x : all) {
    if (1ll * x * x * x > n) break;
    for (auto y : all) {
      if (1ll * x * y * y > n) break;
      if (n % (1ll * x * y) || y < x) continue;
      long long z = n / (1ll * x * y);
      solve(x, y, z);
    }
  }
  cout << res;
}
