#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long n;
long long ans = 0;
vector<long long> g;
int main() {
  cin >> n;
  if (n % 3) {
    cout << 0 << endl;
    return 0;
  }
  n /= 3;
  for (long long i = 2; i * i <= n; ++i)
    if (n % i == 0) {
      g.push_back(i);
    }
  for (int i = 0, l1 = g.size(); i < l1 && g[i] * g[i] * g[i] <= n; ++i) {
    for (int j = i; j < l1 && g[i] * g[j] * g[j] <= n; ++j) {
      if (n % (g[i] * g[j])) continue;
      long long z = n / g[i] / g[j];
      if ((g[i] + g[j] + z) & 1) continue;
      if (g[i] + g[j] <= z) continue;
      if (g[i] == z)
        ans++;
      else if (g[i] != g[j] && g[j] != z)
        ans += 6;
      else
        ans += 3;
    }
  }
  cout << ans << endl;
}
