#include <bits/stdc++.h>
using namespace std;
uint64_t mysqrt(uint64_t k) {
  uint64_t lo = 1;
  uint64_t hi = k;
  while (lo <= hi) {
    uint64_t mid = lo + (hi - lo) / 2;
    if (mid * mid > k)
      hi = mid - 1;
    else if (mid * mid < k)
      lo = mid + 1;
    else
      return mid;
  }
  return hi;
}
int main() {
  uint64_t n;
  cin >> n;
  if (n % 3 != 0) {
    printf("0\n");
    return 0;
  }
  n = n / 3;
  uint64_t soln = 0;
  for (uint64_t x = 2; x * x * x <= n; x++) {
    if (n % x != 0) continue;
    uint64_t nx = n / x;
    uint64_t sqnx = mysqrt(nx);
    for (uint64_t y = sqnx; y >= x; y--) {
      if (nx % y != 0) continue;
      uint64_t z = nx / y;
      uint64_t s2 = x + y + z;
      if (s2 <= 2 * z) break;
      if (s2 % 2 == 0) {
        if (x == y && y == z)
          soln++;
        else if (x == y || y == z || x == z)
          soln += 3;
        else
          soln += 6;
      }
    }
  }
  cout << soln << "\n";
}
