#include <bits/stdc++.h>
using namespace std;
long long n, i, j, x, y, z, a, b, c, ans, k, d[1000000];
int main() {
  scanf("%lld", &n);
  if (n % 3) printf("0"), exit(0);
  n /= 3;
  for (i = 2; i * i <= n; i++)
    if (n % i == 0) d[++k] = i;
  for (x = 1; x <= k; x++)
    if (n % d[x] == 0)
      for (y = x; y <= k; y++)
        if ((n / d[x]) % d[y] == 0) {
          z = n / d[x] / d[y];
          if (z < d[y]) continue;
          if ((d[x] + d[y] + z) % 2 == 0 && d[x] + d[y] > z &&
              d[x] + z > d[y] && z + d[y] > d[x]) {
            if (d[x] == d[y] && d[y] == z)
              ans++;
            else if (d[x] == d[y] || d[y] == z || d[x] == z)
              ans += 3;
            else
              ans += 6;
          }
        }
  printf("%lld", ans);
  return 0;
}
