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