#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;
  int ans = 0;
  for (long long i = 2; i * i * i <= n; i++) {
    if (n % i) continue;
    long long m = n / i;
    for (long long j = max(i, (long long)(-i + sqrt(i * i + 4 * m)) / 2);
         j * j <= m; j++) {
      if (m % j) continue;
      long long k = m / j;
      if ((i + j) > k) {
        if (i == j && j == k)
          ans += 1;
        else {
          if ((i + j - k) % 2 || (i + k - j) % 2 || (j + k - i) % 2)
            continue;
          else {
            int a = (i + j - k) / 2, b = (i + k - j) / 2, c = (j + k - i) / 2;
            if (a == b && b == c) ans += 1;
            if (a < b && b < c) ans += 6;
            if (a == b && b < c) ans += 3;
            if (a < b && b == c) ans += 3;
          }
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
