#include <bits/stdc++.h>
const double eps = 1e-9;
const double pi = acos(-1);
const int oo = 1000000000;
const int mod = 1000000007;
const double E = 2.7182818284590452353602874713527;
using namespace std;
int rec[10000001];
bool check(int a, int b, int c) {
  if (a + b <= c || a + c <= b || b + c <= a) return 0;
  if (((a + b - c) & 1) || ((a - b + c) & 1) || ((-a + b + c) & 1)) return 0;
  return 1;
}
int main() {
  long long n;
  int o = 0, ans = 0;
  cin >> n;
  if (n % 3 != 0)
    cout << 0 << endl;
  else {
    n /= 3;
    for (int i = 1; 1LL * i * i <= n; i++)
      if (n % i == 0) rec[++o] = i;
    for (int i = 1; i <= o; i++) {
      long long t = n / rec[i];
      for (int j = 1; j <= o; j++)
        if (t % rec[j] == 0) {
          long long c = t / rec[j];
          if (1LL * c * c <= n && check(rec[i], rec[j], c)) ans++;
        }
    }
    cout << ans << endl;
  }
  return 0;
}
