#include <bits/stdc++.h>

using namespace std;

int main(){
    int x;
    scanf("%d",&x);
    int t=1; //time
    while(x>0){
        if(x-t<0 || (x-t<t+1 && x-t!=0));
        else x-=t;
        t++;
    }
    printf("%d\n",t-1);
    return 0;
}
