#include <bits/stdc++.h>
using namespace std;
int yi[10010];
int main() {
  long long n, tt, tmp, a, b, c;
  while (cin >> n) {
    int ans = 0;
    if (n % 3 == 0) {
      n /= 3;
      int cnt = 0;
      for (long long i = 2; i * i <= n; ++i)
        if (n % i == 0) yi[cnt++] = i;
      for (int i = 0; i < cnt; ++i)
        for (int j = i; j < cnt; ++j) {
          tt = (long long)(yi[i] * yi[j]);
          if (n % tt == 0 && n / tt >= yi[j]) {
            tt = n / tt;
            tmp = yi[i] + yi[j] + tt;
            if (tmp & 1) continue;
            if (yi[i] + yi[j] <= tt) continue;
            tmp /= 2;
            a = tmp - tt, b = tmp - yi[j], c = tmp - yi[i];
            if (a <= 0 || b <= 0 || c <= 0 || a > b || a > c || b > c) continue;
            if (a == c)
              ++ans;
            else
              ans += (a == b || b == c) ? 3 : 6;
          }
        }
    }
    printf("%d\n", ans);
  }
  return 0;
}
