#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000;
long long n;
vector<int> divisor;
void Make_div(long long n, vector<int> &v) {
  int i;
  if (n % 3 != 0) return;
  n /= 3;
  v.clear();
  for (i = 1; i * 1ll * i < n; i++) {
    if (n % i == 0) v.push_back(i);
  }
  if (n % i == 0) v.push_back(i);
}
int main() {
  int i, j, cnt, t, val[4] = {0, 1, 3, 6}, A, B;
  long long C, a, b, c;
  while (cin >> n) {
    cnt = 0;
    Make_div(n, divisor);
    for (i = 0; i < divisor.size(); i++) {
      A = divisor[i];
      for (j = i; j < divisor.size(); j++) {
        B = divisor[j];
        C = n / (3 * 1ll * B * A);
        if (A * 1ll * B * C == n / 3) {
          a = (A - B + C);
          b = (B - C + A);
          c = (C - A + B);
          if (a > 0 && a <= b && b <= c && !(a & 1) && !(b & 1) && !(c & 1)) {
            if (a == b && b == c)
              cnt += 1;
            else if (a == b || b == c)
              cnt += 3;
            else
              cnt += 6;
          }
        }
      }
    }
    cout << cnt << endl;
  }
  return 0;
}
