#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<long long int, char> p1, pair<long long int, char> p2) {
  return p1.first > p2.first;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  if (n % 3 != 0) {
    cout << "0" << endl;
    return 0;
  }
  long long int p = n / 3, i, j;
  vector<long long int> v;
  for (i = 2; i * i < p; i++) {
    if (p % i == 0) v.push_back(i);
  }
  n = v.size();
  long long int ans = 0;
  for (i = 0; i < n; i++) {
    long long int x = p / v[i];
    for (j = i; j < n; j++) {
      long long int y = x / v[j];
      if (v[j] <= y && (v[i] + v[j] + y) % 2 == 0 && x % v[j] == 0 &&
          v[i] + v[j] > y) {
        if (v[i] == v[j] && v[j] == y)
          ans++;
        else if (v[j] == v[i] or v[j] == y or v[i] == y)
          ans += 3;
        else
          ans += 6;
      }
    }
  }
  cout << ans << endl;
}
