#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long long> v;
  long long n, x, y, z, N, ans = 0;
  cin >> n;
  if (n % 3 == 0) {
    n /= 3;
    for (long long i = 1; i * i <= n; i++) {
      if (n % i == 0) v.push_back(i);
    }
    for (int i = 0; i < v.size(); i++) {
      x = v[i];
      if (x * x * x > n) break;
      N = n / x;
      for (int j = i; j < v.size(); j++) {
        y = v[j];
        if (y * y > N) break;
        if (N % y == 0) {
          z = N / y;
          if ((x + y + z) % 2 == 0 && x + y > z) {
            if (x == y && y == z)
              ans += 1;
            else if (x != y && y != z)
              ans += 6;
            else
              ans += 3;
          }
        }
      }
    }
    cout << ans << endl;
  } else {
    cout << "0\n";
  }
  return 0;
}
