// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#define dibs reserve
#define OVER9000 123456789012345678LL
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) ((x < 0)?-(x):x)
#define uint unsigned int
#define dbl long double
using namespace std;
// mylittledoge
int main() {
cin.sync_with_stdio(0);
int N;
cin >> N;
int d =0, a =3;
while(d+a <= N) {
d +=a;
a++;}
cout << a-3 << "\n";
return 0;}
// look at my code
// my code is amazing
Ly8gaW9zdHJlYW0gaXMgdG9vIG1haW5zdHJlYW0KI2luY2x1ZGUgPGNzdGRpbz4KLy8gYml0Y2ggcGxlYXNlCiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGNzdGRsaWI+CiNpbmNsdWRlIDx2ZWN0b3I+CiNpbmNsdWRlIDxzZXQ+CiNpbmNsdWRlIDxtYXA+CiNpbmNsdWRlIDxxdWV1ZT4KI2luY2x1ZGUgPHN0YWNrPgojaW5jbHVkZSA8bGlzdD4KI2luY2x1ZGUgPGNtYXRoPgojaW5jbHVkZSA8aW9tYW5pcD4KI2RlZmluZSBkaWJzIHJlc2VydmUKI2RlZmluZSBPVkVSOTAwMCAxMjM0NTY3ODkwMTIzNDU2NzhMTAojZGVmaW5lIEFMTF9USEUoQ0FLRSxMSUUpIGZvcihhdXRvIExJRSA9Q0FLRS5iZWdpbigpOyBMSUUgIT0gQ0FLRS5lbmQoKTsgTElFKyspCiNkZWZpbmUgdGlzaWMgNDcKI2RlZmluZSBzb2Nsb3NlIDFlLTgKI2RlZmluZSBjaG9jb2xhdGUgd2luCi8vIHNvIG11Y2ggY2hvY29sYXRlCiNk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