#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     int ans = 0, last = 0, current = 0;     while (n > 0) {       ans++;       current = last + ans;       last = current;       n -= current;       if (n < 0) {         ans--;       }     }     cout << ans;   }   