#include <bits/stdc++.h>
using namespace std;
struct point {
  int x, y;
  point(int x, int y) : x(x), y(y) {}
  bool operator<(const point &r) const { return x == r.x ? y < r.y : x < r.x; }
};
long long int n;
int main() {
  cin >> n;
  if (n % 3 != 0) {
    cout << 0;
    return 0;
  }
  n /= 3;
  vector<int> dels;
  long long int sq = ceil(sqrt(n + .0));
  for (long long int i = 2; i <= sq; i++) {
    if (n % i == 0) {
      dels.push_back(i);
      if (i * i != n) {
        dels.push_back(n / i);
      }
    }
  }
  sort(dels.begin(), dels.end());
  int len = (int)(dels.size());
  long long int ans = 0;
  for (int i = 0; i < len; i++) {
    long long int a = dels[i];
    long long int na = (n / a);
    for (int j = 0; j < len; j++) {
      long long int b = dels[j];
      if (b >= na) break;
      if (na % b != 0) {
        continue;
      }
      long long int c = na / b;
      if (c < 2 || n % c != 0) {
        continue;
      }
      if (a + b - c > 1 && a - b + c > 1 && -a + b + c > 1 &&
          ((a + b - c) & 1) == 0 && ((a - b + c) & 1) == 0 &&
          ((-a + b + c) & 1) == 0) {
        ans++;
      }
    }
  }
  cout << ans;
  return 0;
}
