#include <bits/stdc++.h>
using namespace std;
long long f(long long x, long long y, long long z) {
  return (x + y + z) * (x + y + z) * (x + y + z) - x * x * x - y * y * y -
         z * z * z;
}
long long sqr(long long x) {
  long long d = (long long)(sqrt(x) + 0.5);
  if (d * d == x) return d;
  return -1;
}
int func(long long x, long long y, long long z) {
  if (x == y && y == z) return 1;
  if (x == y || y == z) return 3;
  return 6;
}
vector<long long> v;
int main(void) {
  long long N, x, y, z;
  int i, j;
  long long ans = 0;
  cin >> N;
  for (long long d = 1; d * d <= N; d++)
    if (N % d == 0) {
      v.push_back(d);
      if (d * d != N) v.push_back(N / d);
    }
  sort(v.begin(), v.end());
  i = 0;
  int sz = v.size();
  for (x = 1; f(x, x, x) <= N; x++) {
    while (i < sz && v[i] < 2 * x) i++;
    long long low = x, high = 100000;
    while (high - low > 1) {
      long long mid = (low + high) / 2;
      if (f(x, mid, mid) <= N)
        low = mid;
      else
        high = mid;
    }
    for (j = i; j < sz; j++) {
      long long y = v[j] - x;
      if (y > low) break;
      long long s = x + y;
      long long t = N - 3 * x * y * (x + y);
      if (t % (3 * s) == 0) {
        t /= 3 * s;
        long long d = sqr(4 * t + s * s);
        if (d != -1 && (d - s) % 2 == 0) {
          z = (d - s) / 2;
          ans += func(x, y, z);
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
