#include #include #include #include #include #include #include #include #include #include #include #include #include #define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x << "=" << x << endl; #define debug(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << x << endl; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } using namespace std; typedef long long ll; template vector> vec2d(int n, int m, T v){ return vector>(n, vector(m, v)); } template vector>> vec3d(int n, int m, int k, T v){ return vector>>(n, vector>(m, vector(k, v))); } template void print_vector(vector v, char delimiter=' '){ if(v.empty()) { cout << endl; return; } for(int i = 0; i+1 < v.size(); i++) cout << v[i] << delimiter; cout << v.back() << endl; } const int N = 300; const int MX = N*N*N*3; ll v[MX+1]; int cntr[N*N*N*3+1]; void init(){ for(int x = 0; x <= N; x++){ v[x] = x*x*x; } } int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; init(); int x; cin >> x; for(int a = 0; a <= N; a++){ for(int b = a; b <= N; b++){ for(int c = b; c <= N; c++){ int sum = v[a]+v[b]+v[c]; cntr[sum]++; } } } ll ans = 0; for(int c = 0; c <= N; c++){ for(int b = 0; b <= c; b++){ for(int a = 0; a <= b; a++){ int sum = v[a]+v[b]+v[c]; int rem = x-sum; if(0 <= rem && rem <= MX){ ans += cntr[rem]; } } } for(int p = c; p <= N; p++){ for(int q = p; q <= N; q++){ int sum = v[c]+v[p]+v[q]; cntr[sum]--; } } } cout << ans << endl; }