#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, i, j;
  scanf("%lld", &n);
  if (n % 3 != 0) {
    printf("0");
    return 0;
  }
  n /= 3;
  long long lim3 = (long long)(pow(n * 1.0, 1.0 / 3) + 0.5), res = 0;
  for (i = 1; i <= lim3; i++) {
    if (n % i != 0) continue;
    long long y2 = n / i;
    long long lim2 = (long long)(sqrt(y2) + 0.5);
    for (j = lim2; j >= i; j--) {
      if (y2 % j != 0) continue;
      long long z = y2 / j;
      if (i + j <= z) break;
      if ((i + z - j) & 1) continue;
      long long b = (i + z - j) / 2, a = i - b, c = z - b;
      if (a <= 0 || c <= 0) continue;
      if (a == b) {
        if (b == c)
          res++;
        else
          res += 3;
      } else {
        if (b == c || a == c)
          res += 3;
        else
          res += 6;
      }
    }
  }
  printf("%lld", res);
  return 0;
}
