#include <bits/stdc++.h>
using namespace std;
inline int64_t readLong() {
  int64_t a;
  cin >> a;
  return a;
}
inline char getWays(const int64_t x, const int64_t y, const int64_t z) {
  int64_t d = (z - x + y) >> 1LL;
  int64_t a = x - y + d;
  int64_t b = y - d;
  int64_t c = d;
  return (a > 0 && b > 0 && c > 0 && a + b == x && b + c == y && a + c == z)
             ? 1
             : 0;
}
int main() {
  int64_t n = readLong();
  if (n % 3 != 0) {
    cout << "0" << endl;
    return 0;
  }
  n /= 3;
  vector<int64_t> factors;
  for (int64_t i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      factors.push_back(i);
    }
  }
  int64_t res = 0;
  for (size_t i = 0; i < factors.size(); i++) {
    for (size_t j = 0; j < factors.size(); j++) {
      int64_t x = factors[i], y = factors[j];
      if (n % (x * y) != 0) continue;
      int64_t z = n / (x * y);
      res += getWays(x, y, z);
    }
  }
  cout << res << endl;
  return 0;
}
