#include using namespace std; using ll = long long; #define all(a) (a).begin(), (a).end() void solve(){ int x; cin >> x; int MAX = 300*300*300*3; vector> L(MAX+1); assert(false); for(int a=0;a<=300;a++) for(int b=a;b<=300;b++) for(int c=b;c<=300;c++){ int abc = a*a*a+b*b*b+c*c*c; if(abc+MAX < x) continue; if(x/2<=abc && abc<=x){ L[abc].push_back((short)a); } } ll ans = 0; for(int a=0;a<=300;a++) for(int b=a;b<=300;b++) for(int c=b;c<=300;c++){ int abc = a*a*a+b*b*b+c*c*c; if(abc+MAX0){ ans+=(ll)L[y].size() - (ll)(lower_bound(all(L[y]), (short)c)-L[y].begin()); } } cout << ans << endl; } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int T=1; //cin >> T; while(T--) solve(); }