#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const double pi = acos(-1.0);
long long q[10000000];
int main() {
  long long i, n, a, b, c, a1, b1, c1, cnt = 0, ans = 0, s;
  cin >> n;
  if (n % 3) {
    puts("0");
    return 0;
  }
  n /= 3;
  for (i = 1; i * i <= n; i++)
    if (n % i == 0) {
      q[cnt++] = i;
      q[cnt++] = n / i;
    }
  sort(q, q + cnt);
  for (a = 0; a < cnt && q[a] * q[a] * q[a] <= n; a++)
    for (b = a; b < cnt && q[a] * q[b] * q[b] <= n; b++) {
      if (n / q[a] % q[b] != 0) continue;
      c = n / q[a] / q[b];
      if ((q[a] + q[b] + c) & 1) continue;
      s = (q[a] + q[b] + c) / 2;
      a1 = s - c;
      if (a1 <= 0) continue;
      b1 = s - q[b];
      if (b1 <= 0) continue;
      c1 = s - q[a];
      if (c1 <= 0) continue;
      if (a1 == b1 && b1 == c1)
        ans++;
      else if (a1 == b1 || b1 == c1)
        ans += 3;
      else
        ans += 6;
    }
  cout << ans << endl;
  return 0;
}
