#include "bits/stdc++.h" #include #include using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int x; cin >> x; unordered_map mp; int ans = 0; for (int d = 0; d < 301; ++d) { int c3 = d*d*d; for (int b = 0; b < d + 1; ++b) { int b3 = b * b * b; for (int a = 0; a < b + 1; ++a) { int tx = a * a * a + b3 + c3; mp[tx]++; } } int d3 = c3; for (int e = d; e < 301; ++e) { int e3 = e * e * e; for (int f = e; f < 301; ++f) { const int t = x - (d3 + e3 + f * f * f); if (mp.find(t) == mp.end()) continue; ans += mp[t]; } } } cout << ans << endl; }