#include using namespace std; #include using namespace atcoder; #define rep(i, n) for(int i=0;i<(n);++i) #define rep1(i, n) for(int i=1;i<=(n);i++) #define ll long long using mint = modint998244353; using P = pair; using lb = long double; using T = tuple; templateinline bool chmax(T& a,T b){if(a # define dbg(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__) #else # define dbg(...) (static_cast(0)) #endif int main() { ll x; cin >> x; ll ans = 0; vector>> s; for(int i=0;i<=300;i++){ for(int j=i;j<=300;j++){ for(int k=j;k<=300;k++){ int val = i*i*i+j*j*j+k*k*k; s.emplace_back(val,T(i,j,k)); } } } int m = s.size(); sort(s.begin(),s.end()); vector S; rep(i,m) S.push_back(s[i].first); set> D; rep(i,m){ auto [val, t]= s[i]; int it = lower_bound(S.begin(),S.end(),x-val) - S.begin(); if(S[it]==x-val) { auto [a,b,c] = t; auto [val2, t2] = s[it]; auto [d,e,f] = t2; vector vs; vs.push_back(a); vs.push_back(b); vs.push_back(c); vs.push_back(d); vs.push_back(e); vs.push_back(f); sort(vs.begin(),vs.end()); D.insert(vs); } } cout<