#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  if (n % 3 != 0) {
    cout << 0 << endl;
    return 0;
  }
  n /= 3;
  vector<int> d;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      d.push_back(i);
    }
  }
  sort(d.begin(), d.end());
  set<pair<pair<int, int>, int> > s;
  int ans = 0;
  for (int i = 0; i < d.size(); i++) {
    for (int j = i; j < d.size(); j++) {
      if (n % (d[i] * d[j]) == 0 && n / (d[i] * d[j]) >= d[j]) {
        int x = d[i];
        int y = d[j];
        int z = n / (d[i] * d[j]);
        if ((x + y - z) % 2 != 0) {
          continue;
        }
        if ((x + z - y) % 2 != 0) {
          continue;
        }
        if ((y + z - x) % 2 != 0) {
          continue;
        }
        if (x + y - z == 1 || x + z - y == 1 || y + z - x == 1) continue;
        int a = (x + y - z) / 2;
        int b = (x + z - y) / 2;
        int c = (y + z - x) / 2;
        if (a <= 0 || b <= 0 || c <= 0) continue;
        set<int> temp;
        temp.insert(a);
        temp.insert(b);
        temp.insert(c);
        if (temp.size() == 3)
          ans += 6;
        else if (temp.size() == 2)
          ans += 3;
        else
          ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
