#include <bits/stdc++.h>
using namespace std;
long long n, q[100005];
int ans, top;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  if (n % 3 == 0) {
    n /= 3;
    for (long long i = 1; i * i <= n; i++)
      if (n % i == 0) q[++top] = i;
    for (int i = 1; i <= top; i++)
      for (int j = i; j <= top; j++) {
        long long a = q[i], b = q[j], c = n / a / b;
        if (n % (a * b) == 0 && (a + b + c) % 2 == 0 && a + b > c &&
            a + c > b && b + c > a)
          ans++, ans += (i != j);
      }
  }
  cout << ans << '\n';
  return 0;
}
