#include <bits/stdc++.h>
using namespace std;
long long int fact[1000002];
int main(void) {
  int fc, ans;
  long long int n, i, j, x, y, z, a, b, c, xM, yM, sum;
  scanf("%I64d", &n);
  if (n % 3)
    puts("0");
  else {
    n /= 3;
    fc = 0;
    for (i = 1; i * i <= n; i++) {
      if (!(n % i)) {
        fact[fc++] = i;
        if (n / i != i) fact[fc++] = n / i;
      }
    }
    sort(fact, fact + fc);
    ans = 0;
    xM = (long long int)(pow(n, 1.0 / 3.0) + 0.5);
    for (i = 0; i < fc && fact[i] <= xM; i++) {
      yM = (long long int)(pow(n / fact[i], 1.0 / 2.0) + 0.5);
      for (j = i; j < fc && j <= yM; j++) {
        z = (n / fact[i]) / fact[j];
        if (n % z) continue;
        x = fact[i], y = fact[j];
        if (y > z) break;
        if (x * y * z == n) {
          sum = x + y + z;
          if (sum % 2) continue;
          sum /= 2;
          a = sum - z;
          b = sum - y;
          c = sum - x;
          if (a <= 0 || b <= 0 || c <= 0) continue;
          if (a == b && b == c)
            ans++;
          else {
            if (a == b || a == c || b == c)
              ans += 3;
            else
              ans += 6;
          }
        }
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
