#include <bits/stdc++.h>
using namespace std;
inline void pisz(int n) { printf("%d\n", n); }
template <typename T, typename TT>
ostream& operator<<(ostream& s, pair<T, TT> t) {
  return s << "(" << t.first << "," << t.second << ")";
}
template <typename T>
ostream& operator<<(ostream& s, vector<T> t) {
  for (int(i) = 0; (i) < (((int)((t).size()))); ++(i)) s << t[i] << " ";
  return s;
}
map<unsigned long long, int> roz;
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  if (!a) return b;
  return gcd(b % a, a);
}
unsigned long long mult(unsigned long long a, unsigned long long b,
                        unsigned long long m) {
  if (!a || !b) return 0;
  if (b < (1LL << 31) && a < (1LL << 31)) return (a * b) % m;
  unsigned long long x = 0;
  while (b) {
    if (b & 1) x = (x + a) % m;
    a = (a << 1) % m;
    b >>= 1;
  }
  return x;
}
unsigned long long pow(unsigned long long n, unsigned long long k,
                       unsigned long long m) {
  unsigned long long w = 1;
  while (k) {
    if (k & 1) w = mult(w, n, m);
    n = mult(n, n, m);
    k >>= 1;
  }
  return w;
}
bool TRM(unsigned long long x, int ile) {
  if (x == 2 || x == 3) return 1;
  if (!(x % 2) || !(x % 3) || x == 1) return 0;
  unsigned long long z0 = x - 1;
  int t = 0;
  while (!(z0 & 1)) {
    z0 >>= 1;
    t++;
  }
  while (ile--) {
    unsigned long long b = pow(2 + rand() % (x - 3), z0, x);
    if (b == 1) continue;
    for (int j = 0; j < t && b != x - 1 && b != 1; j++) b = mult(b, b, x);
    if (b != x - 1) return 0;
  }
  return 1;
}
unsigned long long find_factor(unsigned long long z) {
  if (!(z & 1)) return 2;
  unsigned long long c = rand() % z, x = 2, y = 2, d = 1;
  while (d == 1) {
    unsigned long long tp = (mult(y, y, z) + c) % z;
    y = (mult(tp, tp, z) + c) % z;
    x = (mult(x, x, z) + c) % z;
    d = gcd(x > y ? x - y : y - x, z);
  }
  return d;
}
void rhofact(unsigned long long z) {
  if (z == 1) return;
  if (TRM(z, 10)) {
    roz[z]++;
    return;
  }
  while (1) {
    unsigned long long f = find_factor(z);
    if (f != z) {
      rhofact(f);
      rhofact(z / f);
      break;
    }
  }
}
vector<pair<long long, int> > rozklad(long long x) {
  roz.clear();
  rhofact(x);
  vector<pair<long long, int> > res;
  for (typeof(roz.begin()) it = roz.begin(); it != roz.end(); it++)
    res.push_back(*it);
  return res;
}
int main() {
  long long n;
  cin >> n;
  if (n % 3) {
    pisz(0);
    return 0;
  }
  n /= 3;
  vector<pair<long long, int> > roz = rozklad(n);
  int res = 0;
  int m = ((int)((roz).size()));
  vector<int> v(m, 0);
  while (1) {
    vector<int> w(m, 0);
    while (1) {
      long long a = 1, b = 1;
      for (int(j) = 0; (j) < (m); ++(j)) {
        for (int(u) = 0; (u) < (v[j]); ++(u)) a *= roz[j].first;
        for (int(u) = 0; (u) < (w[j]); ++(u)) b *= roz[j].first;
      }
      long long c = n / a / b;
      if ((a + b + c) % 2 == 0)
        if (a + b > c && a + c > b && b + c > a) ++res;
      int j = 0;
      while (j < m) {
        w[j]++;
        if (w[j] > roz[j].second - v[j]) {
          w[j] = 0;
          j++;
        } else
          break;
      }
      if (j == m) break;
    }
    int j = 0;
    while (j < m) {
      v[j]++;
      if (v[j] > roz[j].second) {
        v[j] = 0;
        j++;
      } else
        break;
    }
    if (j == m) break;
  }
  pisz(res);
}
