#include <bits/stdc++.h>
long long d[100000], ds = 0, n, q, ans = 0;
int main() {
  std::cin >> n;
  if (n % 3 == 0) {
    n /= 3;
    for (q = 1; q * q <= n; ++q)
      if (n % q == 0) d[ds++] = q;
    for (int i = 0; i < ds; ++i)
      for (int j = 0; j < ds; ++j) {
        long long a = d[i], b = d[j], c = n / a / b;
        if (!(n % (a * b) || (a + b + c) % 2) && a + b > c && a + c > b &&
            b + c > a)
          ans++;
      }
  }
  std::cout << ans;
}
