#include <bits/stdc++.h>
using namespace std;
long long p[5000000];
int main() {
  long long n, x, y, z, a, b, c, i, j, k, pc = 0, ans = 0;
  cin >> n;
  if (n % 3) {
    cout << 0 << endl;
    return 0;
  }
  n /= 3;
  for (i = 1; i * i <= n; i++)
    if (n % i == 0) p[pc++] = i;
  for (i = 0; p[i] * p[i] * p[i] <= n && i < pc; i++) {
    long long nn = n / p[i];
    x = p[i];
    for (j = i; p[j] * p[j] <= nn && j < pc; j++)
      if (nn % p[j] == 0) {
        y = p[j], z = nn / y;
        if ((x + y + z) % 2) continue;
        a = (x + z - y) / 2;
        if (a <= 0) continue;
        b = (x + y - z) / 2;
        if (b <= 0) continue;
        c = (y + z - x) / 2;
        if (c <= 0) continue;
        int f = (a == b) + (b == c) + (a == c);
        if (f == 3)
          ans += 1;
        else if (f == 1)
          ans += 3;
        else
          ans += 6;
      }
  }
  cout << ans << endl;
}
