#include <bits/stdc++.h>
int main(void) {
  long long int n;
  long long int x, y, z;
  long long int a, b, c;
  long long int n_3, n_x2;
  long long int ans = 0;
  while (~scanf("%I64d", &n)) {
    if (n % 3 == 0) {
      ans = 0;
      n /= 3;
      n_3 = (long long int)(pow((double)n, 1.0 / 3) + 0.5);
      for (x = 1; x <= n_3; x++) {
        if (n % x) continue;
        n_x2 = (long long int)(sqrt((double)(n / x)) + 0.5);
        for (y = n_x2; y >= x; y--) {
          if ((n / x) % y) continue;
          z = n / x / y;
          if (x + y <= z) break;
          if ((x + y - z) % 2) continue;
          a = (x + y - z) / 2;
          b = x - a;
          c = y - a;
          if (a <= 0 || b <= 0 || c <= 0) continue;
          if (a == b && b == c) {
            ans += 1;
          } else if (a == b) {
            ans += 3;
          } else if (b == c) {
            ans += 3;
          } else
            ans += 6;
        }
      }
      printf("%I64d\n", ans);
    } else
      printf("0\n");
  }
  return 0;
}
