#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:200000000")
const double EPS = 1E-9;
const int INF = 1000000000;
const long long INF64 = (long long)1E18;
const double PI = 3.1415926535897932384626433832795;
long long tupo(long long n) {
  long long ans = 0;
  for (int a = 1; a * a <= n; a++)
    for (int b = 1; b * b <= n; b++)
      for (int c = 1; c * c <= n; c++) {
        long long sum = (a + b + c);
        if (sum * sum * sum == a * a * a + b * b * b + c * c * c + n) {
          cerr << a << ' ' << b << ' ' << c << endl;
          ans++;
        }
      }
  return ans;
}
vector<long long> a;
vector<int> b;
long long on, ans;
void solve(long long d1, long long d2) {
  long long d3 = on / d1 / d2;
  long long c2 = d2 + d3 - d1;
  if (c2 % 2) return;
  long long c = c2 / 2;
  long long b = d3 - c;
  long long a = d1 - b;
  if (a <= 0 || b <= 0 || c <= 0) return;
  ans++;
}
void rec(int pos, long long d1, long long d2) {
  if (pos == (int)a.size()) return solve(d1, d2);
  long long nd1 = d1;
  for (int i = 0; i <= b[pos]; i++) {
    long long nd2 = d2;
    for (int j = 0; i + j <= b[pos]; j++) {
      rec(pos + 1, nd1, nd2);
      nd2 *= a[pos];
    }
    nd1 *= a[pos];
  }
}
long long solve(long long n) {
  if (n % 3) return 0;
  n /= 3;
  on = n;
  a.clear();
  b.clear();
  for (long long i = 2; i * i <= n; i++)
    if (n % i == 0) {
      a.push_back(i);
      b.push_back(0);
      while (n % i == 0) {
        n /= i;
        b.back()++;
      }
    }
  if (n > 1) {
    a.push_back(n);
    b.push_back(1);
  }
  ans = 0;
  rec(0, 1, 1);
  return ans;
}
int main() {
  long long n;
  cin >> n;
  cout << solve(n) << endl;
  return 0;
}
