#include <bits/stdc++.h>
using namespace std;
long long n;
int main() {
  cin >> n;
  if (n % 3 != 0)
    cout << 0 << endl;
  else {
    n /= 3;
    int ans = 0;
    long long xmax = 0;
    for (long long i = 1;; i++)
      if (i * i * i > n) {
        xmax = i - 1;
        break;
      }
    for (long long x = xmax; x > 1; x--)
      if (n % x == 0) {
        long long p0 = (long long)sqrt(n / x);
        for (long long y = p0; y >= x; y--)
          if (n % (x * y) == 0) {
            long long z = n / x / y;
            if ((x + y + z) % 2) continue;
            long long tot = (x + y + z) / 2, a = tot - z, b = tot - y,
                      c = tot - x;
            if ((a <= 0) || (b <= 0) || (c <= 0)) break;
            if ((a == b) && (a == c))
              ans++;
            else if (a == b)
              ans += 3;
            else if (a == c)
              ans += 3;
            else if (b == c)
              ans += 3;
            else
              ans += 6;
          }
      }
    cout << ans << endl;
  }
  return 0;
}
