#include <bits/stdc++.h>
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline void sub(long long &a, long long b) {
  a -= b;
  if (a < 0) a += 1000000007;
}
inline void add(long long &a, long long b) {
  a += b;
  if (a >= 1000000007) a -= 1000000007;
}
template <typename T>
inline T const &MAX(T const &a, T const &b) {
  return a > b ? a : b;
}
template <typename T>
inline T const &MIN(T const &a, T const &b) {
  return a < b ? a : b;
}
inline long long qp(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % 1000000007;
    a = a * a % 1000000007, b >>= 1;
  }
  return ans;
}
inline long long qp(long long a, long long b, long long c) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % c;
    a = a * a % c, b >>= 1;
  }
  return ans;
}
using namespace std;
const unsigned long long ba = 233;
const double eps = 1e-5;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int N = 1000 + 10, maxn = 1000000 + 10, inf = 0x3f3f3f3f;
vector<long long> v;
int main() {
  long long n;
  scanf("%lld", &n);
  if (n % 3 != 0) return 0 * puts("0");
  n /= 3;
  for (long long i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      v.push_back(i);
      if (i * i != n) v.push_back(n / i);
    }
  }
  sort(v.begin(), v.end());
  int ans = 0;
  for (int i = 0; i < v.size() && v[i] * v[i] * v[i] <= n; i++) {
    for (int j = i; j < v.size() && v[i] * v[j] * v[j] <= n; j++) {
      long long x = v[i], y = v[j], z = n / v[i] / v[j], a, b, c;
      if (z < y || x * y * z != n) continue;
      if ((x - y + z) % 2 != 0) continue;
      b = (x - y + z) / 2;
      a = x - b;
      c = z - b;
      if (a > b || a > c || b > c || a <= 0 || b <= 0 || c <= 0) continue;
      set<int> s;
      s.insert(a), s.insert(b), s.insert(c);
      if (s.size() == 3)
        ans += 6;
      else if (s.size() == 2)
        ans += 3;
      else
        ans += 1;
    }
  }
  printf("%d\n", ans);
  return 0;
}
