#include <bits/stdc++.h>
int a[100010];
using namespace std;
int main() {
  long long n, a, b, c, x, m;
  string s, t;
  cin >> n;
  long long rez = 0;
  if (n % 3 != 0)
    cout << 0;
  else {
    n = n / 3;
    x = 2;
    while (x * x * x <= n) {
      if (n % x == 0) {
        m = n / x;
        a = 1;
        b = x - a;
        while (a <= b) {
          long long s = sqrt(x * x + 4 * m - 4 * a * b);
          if (s * s == x * x + 4 * m - 4 * a * b) {
            c = (-x + s) / 2;
            if (a == b) {
              if (c == a)
                rez += 1;
              else {
                if (c > b) rez += 3;
              }
            } else {
              if (c == b)
                rez += 3;
              else {
                if (c > b) rez += 6;
              }
            }
          }
          a++;
          b--;
        }
      }
      x++;
    }
    cout << rez;
  }
  return 0;
}
