#include <bits/stdc++.h>
using namespace std;
long long l, r, mid, ans, N, i, j, a, b, c, x, y, z, len;
long long pos[45000], d[45000];
int main() {
  scanf("%I64d\n", &N);
  if (N % 3) {
    printf("0\n");
    return 0;
  }
  N /= 3;
  for (i = 1; (long long)i * i <= N; i++)
    if (N % i == 0) {
      d[len++] = i;
      if ((long long)i * i != N) d[len++] = N / i;
    }
  sort(d, d + len);
  for (i = 0; i < len; i++) {
    l = 0;
    r = len - 1;
    while (l < r) {
      mid = (l + r) >> 1;
      if ((long long)d[i] * d[mid] <= N)
        l = mid;
      else
        r = mid - 1;
      if (l + 1 == r)
        if ((long long)d[i] * d[r] <= N)
          l++;
        else
          r--;
    }
    pos[i] = l;
  }
  for (i = 1; i < len; i++)
    for (j = 1; d[j] * d[j] <= N / d[i]; j++)
      if (N % (d[i] * d[j]) == 0) {
        z = N / (d[i] * d[j]);
        x = d[i];
        y = d[j];
        if ((x + y + z) % 2 == 0 && x + y - z > 1 && y + z - x > 1 &&
            x + z - y > 1)
          ans++;
        swap(y, z);
        if (y == z) continue;
        if ((x + y + z) % 2 == 0 && x + y - z > 1 && y + z - x > 1 &&
            x + z - y > 1)
          ans++;
      }
  printf("%I64d\n", ans);
}
