#include<iostream>
using namespace std;
main(){
int n;
cin >> n;
int count = 1;
int d = 1;
while (n >= d) {
n -= d;
count++;
d += count;
}
cout << count - 1 << endl;
}
I2luY2x1ZGU8aW9zdHJlYW0+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKbWFpbigpewoJaW50IG47CgljaW4gPj4gbjsKCQoJaW50IGNvdW50ID0gMTsKCWludCBkID0gMTsKCXdoaWxlIChuID49IGQpIHsKCQluIC09IGQ7CgkJY291bnQrKzsKCQlkICs9IGNvdW50OwoJfQoJCgljb3V0IDw8IGNvdW50IC0gMSA8PCBlbmRsOwp9Cg==