#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 29;
int e[5000010];
int main() {
  long long n;
  scanf("%I64d", &n);
  if (n % 3 != 0) {
    printf("0\n");
    return 0;
  }
  n /= 3;
  int kk = 0;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) e[kk++] = i;
  }
  int ans = 0;
  for (int i = 0; i < kk; i++) {
    long long t = n / e[i];
    for (int j = i; j < kk; j++) {
      if (t % e[j]) continue;
      long long tt = t / e[j];
      if (tt < e[j]) continue;
      if ((e[i] + e[j] + tt) % 2) continue;
      if ((e[i] - e[j] + tt) <= 0) continue;
      if ((e[j] - tt + e[i]) <= 0) continue;
      if ((tt - e[i] + e[j]) <= 0) continue;
      if (e[i] == e[j] && e[j] == tt)
        ans++;
      else if (e[i] == e[j] || e[j] == tt)
        ans += 3;
      else
        ans += 6;
    }
  }
  printf("%d\n", ans);
}
