#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int64_t n, nprim;
  cin >> n;
  if (n % 3 != 0) {
    cout << "0" << endl;
    return 0;
  }
  n /= 3;
  int64_t a, b, c, rez = 0;
  int64_t x = 1;
  while (x * x * x * 2 <= n) x = (x << 1);
  x = (x >> 1);
  while (x * x * x * 2 <= n) x++;
  for (b = x; b * b <= n; b++) {
    if (n % b != 0) continue;
    nprim = n / b;
    for (a = b; a * (a - b) < nprim; a++) {
      if ((nprim % a) != 0) continue;
      c = nprim / a;
      if (c > b || b + c <= a || (a + b + c) % 2 != 0) continue;
      if (a == b && b == c)
        rez++;
      else if (a > b && b > c)
        rez += 6;
      else
        rez += 3;
    }
  }
  cout << rez << endl;
  return 0;
}
