#include <bits/stdc++.h>
using namespace std;
long long cnt(long long a, long long b, long long c) {
  if (a > b || b > c) return 0LL;
  if (a == b && b == c) return 1LL;
  if (a == b && b < c) return 3LL;
  if (a < b && b == c) return 3LL;
  if (a < b && b < c) return 6LL;
}
int main() {
  long long n;
  scanf("%lld", &n);
  if (n % 3LL)
    printf("0\n");
  else {
    long long ans = 0LL;
    n /= 3LL;
    for (long long sab = 1LL; sab * sab * sab <= n; sab++)
      if (n % sab == 0LL) {
        for (long long a = 1LL; a <= sab - a; a++) {
          long long b = sab - a;
          long long det = sab * sab - 4LL * a * b + 4LL * n / sab;
          if (det < 0LL) continue;
          long long sqdet = 0LL, dd = 1LL << 30LL;
          while (dd) {
            long long nsqdet = sqdet + dd;
            if (nsqdet * nsqdet <= det) sqdet = nsqdet;
            dd >>= 1LL;
          }
          if (sqdet * sqdet == det) {
            long long c = sqdet - sab;
            if (c % 2LL == 0) {
              c /= 2LL;
              ans += cnt(a, b, c);
            }
          }
        }
      }
    printf("%lld\n", ans);
  }
  return 0;
}
