#include <bits/stdc++.h>
const int MAXN = 1e7 + 10;
using namespace std;
long long N;
long long factor[MAXN];
int si;
int main() {
  cin >> N;
  long long A = N / 3;
  if (A * 3 != N) {
    printf("0\n");
    return 0;
  }
  for (long long c = 2; c * c <= A; c++) {
    long long a = A / c;
    if (a * c == A) factor[si++] = c;
  }
  long long sol = 0;
  for (int c = 0; c < si; c++) {
    long long a = factor[c];
    long long b = A / a;
    for (int d = c; d < si; d++) {
      long long x = b / factor[d];
      if (a <= factor[d] and factor[d] <= x and x * factor[d] == b and
          ((a + factor[d] + x) & 1) == 0) {
        if (a + factor[d] > x) {
          if (a == factor[d] and factor[d] == x)
            sol++;
          else if (a == factor[d] or factor[d] == x or a == x)
            sol += 3;
          else
            sol += 6;
        }
      }
    }
  }
  cout << sol << endl;
}
