#include <bits/stdc++.h>
using namespace std;
long long n;
int ans = 0, cnt = 0, divisor[1000006];
bool check(long long a, long long b, long long c) {
  if (a + b <= c || a + c <= b || b + c <= a) return false;
  if (((a + b - c) & 1) || ((a + c - b) & 1) || ((b + c - a) & 1)) return false;
  return true;
}
int main() {
  cin >> n;
  if (n % 3 != 0) {
    puts("0");
    return 0;
  }
  n /= 3;
  for (int i = 1; (long long)i * i <= n; ++i)
    if (n % i == 0) divisor[++cnt] = i;
  for (int i = 1; i <= cnt; ++i) {
    long long rest = n / divisor[i];
    for (int j = 1; j <= cnt; ++j)
      if (rest < divisor[j])
        break;
      else if (rest % divisor[j] == 0) {
        long long c = rest / divisor[j];
        if ((long long)c * c <= n && check(divisor[i], divisor[j], c)) ++ans;
      }
  }
  printf("%d\n", ans);
  return 0;
}
