#include <bits/stdc++.h>
long long int a[10000010], i, j, k, m, n, x, y, z, ans;
int main() {
  while (scanf("%I64d", &n) == 1) {
    if (n % 3 != 0) {
      printf("0\n");
      continue;
    }
    n /= 3;
    k = 0;
    for (i = 2; i * i <= n; i++) {
      if (n % i == 0) {
        a[k] = i;
        k++;
      }
    }
    ans = 0;
    for (i = 0; i < k; i++) {
      for (j = i; j < k; j++) {
        x = a[i];
        y = a[j];
        m = x * y;
        z = n / m;
        if (z * m != n) continue;
        if ((x + y + z) % 2 != 0) continue;
        if (x + y <= z) continue;
        if (z < y) continue;
        if (x == y && y == z)
          ans++;
        else if (x == y || y == z)
          ans += 3;
        else
          ans += 6;
      }
    }
    printf("%I64d\n", ans);
  }
  return 0;
}
