#include <bits/stdc++.h>
using namespace std;
long long n, a[10000000], cnt, ans;
int main() {
  cin >> n;
  if (n % 3) {
    printf("0\n");
    return 0;
  }
  n /= 3;
  for (long long i = 1; i * i <= n; i++)
    if (n % i == 0) a[++cnt] = i;
  for (int i = 1; i <= cnt; i++)
    for (int j = cnt; j >= 1; j--) {
      long long x = a[i], y = a[j], z = n / x / y;
      if (x * y * z != n) continue;
      if ((x + y + z) & 1) continue;
      if (x > y) break;
      if (y > z) continue;
      if (x + y <= z) break;
      if (x + z <= y) break;
      if (y + z <= x) break;
      if (x == y && y == z)
        ans++;
      else if (x == y || y == z || x == z)
        ans += 3;
      else
        ans += 6;
    }
  cout << ans << endl;
  return 0;
}
