#include using namespace std; const int MAX = 300; int main(){ int X; cin >> X; vector> L(MAX + 1), R(MAX + 1); for (int i = 0; i <= MAX; i++){ for (int j = i; j <= MAX; j++){ for (int k = j; k <= MAX; k++){ int s = i * i * i + j * j * j + k * k * k; L[k][s]++; R[i][s]++; } } } int ans = 0; unordered_map mp; for (int i = 0; i <= MAX; i++){ for (pair P : L[i]){ mp[P.first] += P.second; } for (pair P : R[i]){ if (mp.count(X - P.first) != 0){ ans += mp[X - P.first] * P.second; } } } cout << ans << endl; }