#include <bits/stdc++.h>
using namespace std;
long long p[10000005];
int idxp;
int main() {
  long long n;
  int i, j;
  long long countt = 0;
  scanf("%I64d", &n);
  if (n % 3 != 0)
    printf("0\n");
  else {
    n = n / 3;
    long long r = (long long)sqrt(n);
    for (i = 1; i <= r; i++) {
      if (n % i == 0) p[idxp++] = i;
    }
    for (i = 0; i < idxp; i++) {
      for (j = i; j < idxp; j++) {
        long long C = n / (p[i] * p[j]);
        if (p[i] * p[j] * C == n) {
          long long A = p[i], B = p[j];
          if ((A + B + C) & 1) continue;
          if (A + B <= C) continue;
          if (C < B) continue;
          if (A == B && B == C)
            countt++;
          else if (A == B || B == C)
            countt += 3;
          else
            countt += 6;
        }
      }
    }
    printf("%I64d\n", countt);
  }
  scanf(" ");
}
