#include <bits/stdc++.h>
using namespace std;
long long n;
long long x[10000111], X = 0;
long long ans = 0;
int main() {
  long long i, j, k;
  long long p, q, r;
  long long t, tt, ttt;
  long long A, B, C;
  scanf("%I64d", &n);
  if (n % 3 != 0) {
    printf("0");
    return 0;
  }
  n /= 3;
  for (i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      x[X] = i;
      X++;
    }
  }
  for (i = 0; i < X; i++) {
    for (j = i; j < X; j++) {
      A = x[i];
      B = x[j];
      t = A * B;
      C = n / t;
      if (C * t != n) continue;
      if ((A + B + C) & 1) continue;
      if (A + B <= C) continue;
      if (C < B) continue;
      if (A == B and B == C)
        ans++;
      else if (A == B or B == C)
        ans += 3;
      else
        ans += 6;
    }
  }
  printf("%I64d", ans);
  scanf(" ");
  return 0;
}
