#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  if (N % 3) {
    printf("0\n");
    return 0;
  }
  N /= 3;
  static long long A[1000000];
  int Total = 0;
  for (long long i = 1; i * i <= N; i++)
    if (!(N % i)) A[Total++] = i;
  if (A[Total - 1] * A[Total - 1] == N) {
    for (int i = Total; i < Total * 2 - 1; i++) A[i] = N / A[Total * 2 - 2 - i];
    Total = Total * 2 - 1;
  } else {
    for (int i = Total; i < Total * 2; i++) A[i] = N / A[Total * 2 - 1 - i];
    Total *= 2;
  }
  int Ans = 0;
  for (int i = 0; i < Total && A[i] * A[i] * A[i] <= N; i++)
    for (int j = i; j < Total && A[i] * A[j] * A[j] <= N; j++)
      if (!(N % (A[i] * A[j])) && A[i] + A[j] > N / A[i] / A[j] &&
          !((A[i] + A[j] + N / A[i] / A[j]) % 2))
        if (i == j && A[i] * A[i] * A[i] == N)
          Ans++;
        else if (i == j || A[i] * A[j] * A[j] == N)
          Ans += 3;
        else
          Ans += 6;
  printf("%d\n", Ans);
  return 0;
}
