#include <bits/stdc++.h>
using namespace std;
long long T, n, m, k, t;
long long s[10000009];
int main() {
  int ncase = 0;
  while (scanf("%I64d", &n) == 1) {
    if (n % 3) {
      printf("0\n");
      continue;
    }
    n /= 3;
    int cnt = 0;
    for (long long i = 2; i * i <= n; i++)
      if (n % i == 0) {
        s[cnt++] = i;
      }
    long long ans = 0;
    for (int i = 0; i < cnt; ++i)
      for (int j = i; j < cnt; j++) {
        long long a = s[i], b = s[j];
        long long c = n / (a * b);
        if (a * b * c != n) continue;
        if (a + b < c + 2) continue;
        if ((a + b - c) % 2) continue;
        if (c < b) break;
        if (a == b && a == c)
          ans++;
        else if (a == b || b == c)
          ans += 3;
        else
          ans += 6;
      }
    cout << ans << endl;
  }
  return 0;
}
