#include <bits/stdc++.h>
using namespace std;
long long n, x, y, z, ans, a1, a2, a3, r1, r2;
set<long long> a;
set<long long>::const_iterator i, j;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  if (n % 3 != 0)
    cout << "0";
  else {
    n /= 3;
    for (long long i = 1; i * i <= n; i++)
      if (n % i == 0) {
        a.insert(i);
      }
    for (i = a.begin(); i != a.end(); i++) {
      r1 = n / (*i);
      for (set<long long>::const_iterator j = i; j != a.end(); j++)
        if (r1 % (*j) == 0) {
          r2 = r1 / (*j);
          if (r2 >= *j)
            if (a.find(r2) != a.end()) {
              x = *i;
              y = *j;
              z = r2;
              if (x + y > z && x + z > y && y + z > x && (x + y - z) % 2 == 0 &&
                  (x + z - y) % 2 == 0 && (y + z - x) % 2 == 0) {
                a1 = (x + y - z) / 2;
                a2 = (x + z - y) / 2;
                a3 = (y + z - x) / 2;
                if (a1 == a2 && a2 == a3)
                  ans++;
                else if (a3 == a1 || a3 == a2 || a1 == a2)
                  ans += 3;
                else
                  ans += 6;
              }
            }
        }
    }
    cout << ans;
  }
}
