#include <bits/stdc++.h>
using namespace std;
int main() {
  long long d, i, j, a, b, c, t = 0, nn;
  long long n;
  cin >> n;
  if (n % 3) {
    cout << 0;
    return (0);
  }
  n = n / 3;
  for (i = 2; i * i * i <= n; i++)
    if (n % i == 0) {
      nn = n / i;
      for (a = 1; a <= i / 2; a++) {
        b = i - a;
        d = (a + b) * (a + b) - 4 * (a * b - nn);
        if (d > 0 && int64_t(sqrt(d)) * int64_t(sqrt(d)) == d) {
          c = -(a + b) + int(sqrt(d));
          if (c / 2 >= b && c % 2 == 0) {
            c = c / 2;
            if (a == b && a == c)
              t++;
            else if (a == b || a == c || b == c)
              t += 3;
            else
              t += 6;
          }
        }
      }
    }
  cout << t;
}
