#include <bits/stdc++.h>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            .h>
using namespace std;
#define ll long long
ll n,m;
ll num[2000000];
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