#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  if (n % 3) {
    cout << 0 << endl;
    return 0;
  }
  n /= 3;
  vector<long long> size;
  for (long long i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      size.push_back(i);
    }
  }
  int length = size.size();
  int amount = 0;
  long long buf1, buf2, buf3, buf;
  for (int i = 0; i < length; i++) {
    for (int j = 0; j < length; j++) {
      buf = n / (size[i] * size[j]);
      if (size[i] * size[j] * buf == n) {
        buf1 = size[i] + size[j] - buf;
        buf2 = size[i] - size[j] + buf;
        buf3 = -size[i] + size[j] + buf;
        if (buf1 > 0 && buf2 > 0 && buf3 > 0 && (buf1 % 2 == 0) &&
            (buf2 % 2 == 0) && (buf3 % 2 == 0))
          amount++;
      }
    }
  }
  cout << amount << endl;
  return 0;
}
