#include // #include using namespace std; using namespace numbers; int main(){ cin.tie(0)->sync_with_stdio(0); cin.exceptions(ios::badbit | ios::failbit); vector> left(301), right(301); for(auto x = 0; x <= 300; ++ x){ for(auto y = x; y <= 300; ++ y){ for(auto z = y; z <= 300; ++ z){ left[z].push_back(x * x * x + y * y * y + z * z * z); right[x].push_back(x * x * x + y * y * y + z * z * z); } } } for(auto x = 0; x <= 300; ++ x){ ranges::sort(left[x]); ranges::sort(right[x] | ranges::views::reverse); } int obj; cin >> obj; int res = 0; for(auto c = 0; c <= 300; ++ c){ for(auto d = c; d <= 300; ++ d){ for(auto cl = 0, dl = 0; cl < (int)left[c].size() && left[c][cl] <= obj / 2; ){ int cr = cl; while(cr < (int)left[c].size() && left[c][cl] == left[c][cr]){ ++ cr; } int rem = obj - left[c][cl]; while(dl < (int)right[d].size() && right[d][dl] > rem){ ++ dl; } int dr = dl; while(dr < (int)right[d].size() && right[d][dr] == rem){ ++ dr; } res += (cr - cl) * (dr - dl); cl = cr; dl = dr; } } } cout << res << "\n"; return 0; } /* */ //////////////////////////////////////////////////////////////////////////////////////// // // // Coded by Aeren // // // ////////////////////////////////////////////////////////////////////////////////////////