#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long n, ans = 0;
  cin >> n;
  if (n % 3 != 0) goto gg;
  n /= 3;
  for (long long i = 2; i * i * i <= n; ++i) {
    if (n % i != 0) continue;
    for (long long j = sqrt(n / i); j >= i; j--) {
      if (n % (i * j) != 0) continue;
      long long k = n / (i * j);
      if ((i + j + k) % 2 == 1) continue;
      if (i + j <= k) break;
      if (i == k)
        ans++;
      else if (i == j || j == k)
        ans += 3;
      else
        ans += 6;
    }
  }
gg:;
  cout << ans << endl;
  return 0;
}
