#include<iostream>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<string>
#include<string.h>
#include<cstring>
using namespace std;
const int maxn = 143;
int u[maxn];
int main(){
u[1] = 1;
for(int i = 2; i < maxn; ++i){
u[i] = u[i-1]+i;
}
int n;
cin >> n;
int sum = 0, cnt = 0, i;
for(i = 1; (sum + u[i]) <= n && i < maxn; ++i){
sum += u[i];
++cnt;
}
cout << cnt << endl;
return 0;
}
Codeforces 492A
点赞
收藏