#include <bits/stdc++.h>
using namespace std;
long long result = 0;
void check(long long a, long long b, long long c, long long n) {
  if (a <= 0) return;
  if (b <= 0) return;
  if (c <= 0) return;
  if (a > b) return;
  if (b > c) return;
  long long inc = 0;
  if (a == b && b == c)
    inc = 1;
  else if (a == b || b == c)
    inc = 3;
  else
    inc = 6;
  if (a * a * a + b * b * b + c * c * c + n ==
      (a + b + c) * (a + b + c) * (a + b + c))
    result += inc;
}
int main() {
  long long n;
  cin >> n;
  if (n % 3 != 0) {
    cout << "0";
    return 0;
  }
  n /= 3;
  for (long long x = 1; x * x * x <= n; x++)
    if (n % x == 0) {
      long long t = n / x;
      for (long long a = 1; a <= x / 2; a++) {
        long long b = x - a;
        long long D = (a + b) * (a + b) - 4 * (a * b - t);
        if (D < 0) continue;
        long long q = (long long)sqrt(D);
        if (q * q != D) continue;
        if (D == 0) {
          long long c = (-(a + b)) / 2;
          check(a, b, c, n * 3);
        } else {
          long long c = (-(a + b) + q) / 2;
          check(a, b, c, n * 3);
          c = (-(a + b) - q) / 2;
          check(a, b, c, n * 3);
        }
      }
    }
  cout << result;
}
