#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  vector<long long> v;
  cin >> n;
  if (n % 3)
    cout << 0;
  else {
    n /= 3;
    int ans = 0, a, b, c;
    for (int i = int(sqrt(n)); i >= 2; i--)
      if (n % i == 0) v.push_back(i);
    for (int i = v.size() - 1; i >= 0; i--) {
      a = v[i];
      for (int j = v.size() - 1; j >= 0; j--)
        if ((n / v[i]) % v[j] == 0) {
          b = v[j], c = n / v[i] / v[j];
          if ((a + b - c) % 2 == 0 && (b + c - a) % 2 == 0 &&
              (c + a - b) % 2 == 0 && (a + b - c) > 0 && (b + c - a) > 0 &&
              (c + a - b) > 0)
            ans++;
        }
    }
    cout << ans;
  }
}
