#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
const long double PI = 3.1415926535897932384626433832795;
int main() {
  long long n;
  cin >> n;
  if (n % 3) {
    cout << 0 << endl;
    return 0;
  }
  n /= 3;
  vector<long long> d;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      d.push_back(i);
      if (i * i < n) d.push_back(n / i);
    }
  }
  sort(d.begin(), d.end());
  long long ans = 0;
  int cnt = d.size();
  for (int i = 0; i < (int)(cnt); i++) {
    for (int j = i; j < cnt; j++) {
      if (d[i] * d[j] * d[j] > n) break;
      long long x = d[i];
      long long y = d[j];
      if (n % (x * y)) continue;
      long long z = n / (x * y);
      if (z < y) continue;
      if (x + y - z <= 0) continue;
      if ((x + y - z) % 2) continue;
      if (x == y && y == z)
        ans++;
      else if (x == y || y == z)
        ans += 3;
      else
        ans += 6;
    }
  }
  cout << ans << endl;
  return 0;
}
