#include #include #include #include #include using namespace std; using namespace atcoder; using ll=long long; using mint=modint998244353; #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() template bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;} template bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;} int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); ll X; cin>>X; ll S=0; ll ans=0; vectorvec; for(int x=0;x<=300;x++)for(int y=x;y<=300;y++)for(int z=y;z<=300;z++){ vec.push_back(x*x*x+y*y*y+z*z*z); } sort(all(vec)); vec.erase(unique(all(vec)),vec.end()); int L=vec.size(); unordered_mapmp; for(int i=0;i>V(L),W(L); for(int x=0;x<=300;x++)for(int y=x;y<=300;y++)for(int z=y;z<=300;z++){ V[mp[x*x*x+y*y*y+z*z*z]].push_back(x); } for(int a=0;S<=X&&a<=300;a++){ S+=a*a*a; for(int b=a;S+b*b*b<=X&&b<=300;b++){ S+=b*b*b; for(int c=b;S+c*c*c<=X&&c<=300;c++){ S+=c*c*c; if(mp.count(X-S)){ int d=mp[X-S]; ans+=V[d].end()-lower_bound(all(V[d]),c); } S-=c*c*c; } S-=b*b*b; } S-=a*a*a; } cout<