#include <bits/stdc++.h>
template <class t>
inline void read(t &s) {
  s = 0;
  register long long f = 1;
  register char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) s = (s << 3) + (s << 1) + (c ^ 48), c = getchar();
  s *= f;
  return;
}
template <class t, class... A>
inline void read(t &x, A &...a) {
  read(x);
  read(a...);
}
template <class t>
inline void write(t x) {
  if (x < 0) putchar('-'), x = -x;
  long long buf[21], top = 0;
  while (x) buf[++top] = x % 10, x /= 10;
  if (!top) buf[++top] = 0;
  while (top) putchar(buf[top--] ^ '0');
  return;
}
inline void setIn(std::string s) {
  freopen(s.c_str(), "r", stdin);
  return;
}
inline void setOut(std::string s) {
  freopen(s.c_str(), "w", stdout);
  return;
}
inline void setIO(std::string s = "") {
  setIn(s + ".in");
  setOut(s + ".out");
  return;
}
template <class t>
inline bool ckmin(t &x, t y) {
  if (x > y) {
    x = y;
    return 1;
  }
  return 0;
}
template <class t>
inline bool ckmax(t &x, t y) {
  if (x < y) {
    x = y;
    return 1;
  }
  return 0;
}
inline long long lowbit(long long x) { return x & (-x); }
signed main(void) {
  long long n;
  read(n);
  if (n % 3) return std::puts("0"), 0;
  n /= 3;
  register long long m3 = std::ceil(std::pow(n, 1.0 / 3)), ans = 0;
  for (long long x = 1; x <= m3; ++x) {
    if (n % x) continue;
    register long long m2 = std::ceil(std::sqrt(1.0 * n / x));
    for (long long y = m2; y >= x; --y) {
      register long long z = n / x / y;
      if (z >= x + y) break;
      if (z * x * y != n || z < y) continue;
      if ((x ^ y ^ z) & 1) continue;
      if ((x + z - y) <= 0 || (y + z - x) <= 0) continue;
      if (x == y && y == z)
        ++ans;
      else if (x == y || y == z || x == z)
        ans += 3;
      else
        ans += 6;
    }
  }
  write(ans), std::puts("");
  return 0;
}
