#include <bits/stdc++.h>
using namespace std;
const int lim = 100100;
const int MAXQ = 10010000;
long long N;
int ans = 0;
void check(long long p, long long q, long long r) {
  long long a = p + r - q;
  long long b = p + q - r;
  long long c = q + r - p;
  if (a > 0 && b > 0 && c > 0 && a % 2 == 0) {
    int num = 3;
    if (a == b) --num;
    if (b == c) --num;
    if (a == c) --num;
    if (num == 0) ++num;
    if (num == 1) {
      ans += 1;
    } else if (num == 2) {
      ans += 3;
    } else if (num == 3) {
      ans += 6;
    }
  }
}
int nxt[MAXQ];
int main() {
  cin >> N;
  if (N % 3) {
    cout << "0\n";
    return 0;
  }
  N /= 3;
  int prv = 0;
  for (long long q = 1; q * q <= N; ++q) {
    if (N % q == 0) {
      nxt[prv] = q;
      prv = q;
    }
  }
  nxt[prv] = N;
  for (int p = 1; p <= lim; ++p) {
    if (N % p == 0) {
      long long m = N / p;
      for (long long q = p; q * q <= m; q = nxt[q]) {
        if (m % q == 0) {
          long long r = N / p / q;
          check(p, q, r);
        }
      }
    }
  }
  cout << ans << "\n";
}
