#include <bits/stdc++.h>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            .h>
using namespace std;
#define ll long long
ll n,m;
ll i;
int main()
{
    cin>>n;
    for(i=1;;i++)
    {
        m+=i;
        if(m>=n)
        {
            break;
        }
    }
    cout<<min(i,n)<<endl;
    return 0;
}


Measured memory_bytes: 256