#include <bits/stdc++.h>
using namespace std;
map<pair<pair<long long, long long>, pair<long long, long long> >, int> used;
long long res, x, p[100][100];
vector<pair<long long, long long> > v;
void f(int node, long long a, long long b, long long c) {
  if (node == v.size()) {
    double x = (a - b + c) / 2.0;
    double y = a - x, z = c - x;
    if (x == (long long)x && x > 0 && y > 0 && z > 0) res++;
    return;
  }
  int s = v[node].second;
  for (int i = 0; i <= s; i++)
    for (int j = 0; i + j <= s; j++) {
      int k = s - i - j;
      f(node + 1, a * p[node][i], b * p[node][j], c * p[node][k]);
    }
}
int main() {
  cin >> x;
  if (x / 3 * 3 != x) {
    puts("0");
    return 0;
  }
  x /= 3;
  for (int i = 2; i * i <= x; i++) {
    if (x / i * i != x) continue;
    int cnt = 0;
    while (x / i * i == x) cnt++, x /= i;
    v.push_back(pair<long long, long long>(i, cnt));
  }
  if (x != 1) v.push_back(pair<long long, long long>(x, 1));
  for (int qwe = 0; qwe < v.size(); qwe++) {
    p[qwe][0] = 1;
    for (int i = 1; i <= v[qwe].second; i++)
      p[qwe][i] = p[qwe][i - 1] * v[qwe].first;
  }
  f(0, 1, 1, 1);
  cout << res << '\n';
  return 0;
}
