#include <bits/stdc++.h>
using namespace std;
long long n, ans = 0;
long long calc(long long a, long long b, long long c) {
  if ((a + b + c) & 1) return 0;
  if (a == c) return 1;
  if (a == b || b == c) return 3;
  return 6;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  if (n % 3 == 0) {
    n /= 3;
    for (long long i = 2; i * i * i <= n; i++) {
      if (n % i == 0) {
        long long dv = n / i;
        long long st = (long long)sqrt((long double)(4.0 * dv + i * i));
        st = max(i, (st - i) / 2);
        for (long long j = st; j * j <= dv; j++) {
          if (dv % j == 0) {
            long long k = dv / j;
            if (i + j > k) ans += calc(i, j, k);
          }
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
