#include <bits/stdc++.h>
using namespace std;
vector<long long> enum_divisors(long long n) {
  vector<long long> res;
  for (long long i = 1LL; i * i <= n; i++) {
    if (n % i != 0) continue;
    res.emplace_back(i);
  }
  return res;
}
int main() {
  long long n;
  cin >> n;
  if (n % 3) return !(cout << 0 << endl);
  n /= 3;
  auto ds = enum_divisors(n);
  long long cnt = 0;
  for (long long x : ds)
    for (long long y : ds)
      if (x <= y) {
        if (n / x % y) continue;
        long long z = n / x / y;
        if (y > z) continue;
        long long s = x + y + z;
        if (s % 2) continue;
        s /= 2;
        long long a = s - z, b = s - y, c = s - x;
        if (a <= 0 || b <= 0 || c <= 0) continue;
        if (a == c)
          cnt += 1;
        else if (a == b || b == c)
          cnt += 3;
        else
          cnt += 6;
      }
  cout << cnt << endl;
  return 0;
}
