// #include using namespace std; #define fi first #define se second #define all(x) x.begin(), x.end() #define lch (o << 1) #define rch (o << 1 | 1) typedef double db; typedef long long ll; typedef unsigned int ui; typedef pair pint; typedef pair pll; typedef tuple tint; const int N = 1e6 + 5; const int INF = 0x3f3f3f3f; const ll INF_LL = 0x3f3f3f3f3f3f3f3f; vector divs; bool Check(ll a, ll b, ll c) { if (a <= 1 || b <= 1 || c <= 1) return 0; else return (a + b > c) && (a + c > b) && (b + c > a); } int main() { ios::sync_with_stdio(0); ll n; cin >> n; n = n * n; for (ll i = 1; i * i <= n; i++) { if (n % i == 0) { divs.push_back(i); if (n != i * i) divs.push_back(n / i); } } int ans = 0; for (auto x: divs) for (auto y: divs) { ll xyMul = x * y; ll xyAdd = x + y; if (4 * n % xyMul) continue; ll tmp1 = xyAdd * xyAdd + 4 * n / xyMul; ll rt = sqrt(tmp1); if (rt * rt != tmp1) continue; ll tmp2 = rt - xyAdd; if (tmp2 % 2 != 0) continue; ll z = tmp2 / 2; ll s = x + y + z; ll a = s - x; ll b = s - y; ll c = s - z; ans += (Check(a, b, c) && x >= y && y >= z); } cout << ans << endl; return 0; }