#include <bits/stdc++.h>
const double eps = 1e-6;
const double PI = acos(-1.0);
const int inf = 0x1F1F1F1F;
using namespace std;
vector<long long> vc;
int main() {
  long long n, ans;
  long long i, j;
  while (cin >> n) {
    if (n % 3) {
      puts("0");
      return 0;
    }
    vc.clear();
    n /= 3;
    for (i = 2; i * i <= n; ++i) {
      if (n % i == 0) vc.push_back(i);
    }
    ans = 0;
    for (i = 0; i < int(vc.size()) && vc[i] * vc[i] * vc[i] <= n; ++i) {
      long long r = n / vc[i];
      for (j = i; j < int(vc.size()) && vc[j] * vc[j] <= r; ++j) {
        if (r % vc[j]) continue;
        long long s = r / vc[j];
        if (vc[i] + vc[j] <= s) continue;
        if ((vc[i] - s + vc[j]) % 2) continue;
        long long a = (vc[i] - s + vc[j]) / 2;
        long long c = a - vc[i] + s;
        long long b = vc[i] - a;
        if (a == b && b == c)
          ans++;
        else if ((a == b && b < c) || (a < b && b == c))
          ans += 3;
        else if (a < b && b < c)
          ans += 6;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
