stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;

const int N = 2e5 + 3;

int main() {

#ifndef ONLINE_JUDGE

//	freopen("input.in", "r", stdin);

#endif

	long long a, b, c, d;

	scanf("%lld %lld %lld %lld", &a, &b, &c, &d);

	long long res = b / c;

	res -= (a - 1) / c;

	res += b / d;

	res -= (a - 1) / d;

	res -= b / (c * d / __gcd(c, d));

	res += (a - 1) / (c * d / __gcd(c, d));

	printf("%lld\n", (b - a + 1) - res);

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.161707470212018x):
#include<cstdio>

#include<cmath>

#include<cstring>

using namespace std;



long long gcd(long long a,long long b)

{

    return !b?a:gcd(b,a%b);

}



long long lms(long long  a,long long  b)

{

    return (a*b)/gcd(a,b);

}



int main()

{

    long long a,b,c,d,nc=0;

    //long long i,j;

    while(~scanf("%lld%lld%lld%lld",&a,&b,&c,&d)){

    nc=0;

    long long Lms=lms(c,d);

    if(a%c==0) nc++;

    //if(b%c==0) nc++;

    if(a%d==0) nc++;

    //if(b%d==0) nc++;

    nc+=(b/c-a/c);

    nc+=(b/d-a/d);

    if(a%Lms==0) nc--;

    //if(b%Lms==0) nc--;

    nc-=(b/Lms-a/Lms);

    printf("%lld",b-a+1-nc);}

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

typedef long double ld;



ll gcd(ll a,ll b)

{



    if(b==0)

        return a;

    else

        return gcd(b,a%b);

}



ll lcm(ll a,ll b)

{

    return (a/(gcd(a,b)))*b;



}



int main()

{

    ll t=1;





    while(t--)

    {

        ll a,b,c,d;

        //cout<<lcm(3,4)<<endl;

        cin>>a>>b>>c>>d;

        ll tot=b-a+1;

        ll a1=(a-1)/c+(a-1)/d-((a-1)/lcm(c,d));

        ll b1=b/c+b/d-(b/lcm(c,d));

        //ans= tot-ans;

        //cout<<a1<<" "<<b1<<" "<<tot<<endl;

        cout<<tot-(b1-a1)<<endl;



    }









}


// Faster C++ solution for the same problem (measured speedup: 5.228297702491632x):
#include<cstdio>

#include<cmath>

#include<cstring>

using namespace std;



long long gcd(long long a,long long b)

{

    return !b?a:gcd(b,a%b);

}



long long lms(long long  a,long long  b)

{

    return (a*b)/gcd(a,b);

}



int main()

{

    long long a,b,c,d,nc=0;

    //long long i,j;

    while(~scanf("%lld%lld%lld%lld",&a,&b,&c,&d)){

    nc=0;

    long long Lms=lms(c,d);

    if(a%c==0) nc++;

    //if(b%c==0) nc++;

    if(a%d==0) nc++;

    //if(b%d==0) nc++;

    nc+=(b/c-a/c);

    nc+=(b/d-a/d);

    if(a%Lms==0) nc--;

    //if(b%Lms==0) nc--;

    nc-=(b/Lms-a/Lms);

    printf("%lld",b-a+1-nc);}

}
// Slower C++ solution:


/*|In The Name Of Allah|*/



#include <bits/stdc++.h>



using namespace std;



const int N = 1e3+5;



long long a;

long long b;

long long c;

long long d;



long long get(long long A , long long B){

        return A / B;

}



int main(){

    cin >> a >> b >> c >> d;

    long long ans = (b - a + 1) - (get(b , c) + get(b , d) - get(b , c*d/__gcd(c , d)));

    ans +=  get(a-1 , c) + get(a-1 , d) - get(a-1 , c*d/__gcd(c , d));

    cout << ans << endl;

}



// a <= b


// Faster C++ solution for the same problem (measured speedup: 5.229152723611867x):
#include<cstdio>

#include<cmath>

#include<cstring>

using namespace std;



long long gcd(long long a,long long b)

{

    return !b?a:gcd(b,a%b);

}



long long lms(long long  a,long long  b)

{

    return (a*b)/gcd(a,b);

}



int main()

{

    long long a,b,c,d,nc=0;

    //long long i,j;

    while(~scanf("%lld%lld%lld%lld",&a,&b,&c,&d)){

    nc=0;

    long long Lms=lms(c,d);

    if(a%c==0) nc++;

    //if(b%c==0) nc++;

    if(a%d==0) nc++;

    //if(b%d==0) nc++;

    nc+=(b/c-a/c);

    nc+=(b/d-a/d);

    if(a%Lms==0) nc--;

    //if(b%Lms==0) nc--;

    nc-=(b/Lms-a/Lms);

    printf("%lld",b-a+1-nc);}

}
// Slower C++ solution:
//

/*==========================================================*/

/*    Template ver 2017-0720    |    Created by JollyBee    */

/* DOMINUS pascit me, et nihil mihi deerit (Psalmorum 23:1) */

/*==========================================================*/

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

typedef unsigned long long ull;

typedef vector<int> vi;

typedef pair<int,int> pii;

typedef pair<ll,ll> pll;

typedef vector<pii> vii;

const double EPS=(double)1e-9;

const double PI=(double)acos(-1.0);

#define fi first

#define se second

#define mp make_pair

#define pb push_back

#define pob pop_back

#define pf push_front

#define pof pop_front

#define FOR(i,n) for(int i=0;i<n;i++)

#define REPP(i,l,r,c) for(int i=l;i<=r;i+=c)

#define REP(i,l,r) REPP(i,l,r,1)

#define FORD(i,n) for(int i=n-1;i>=0;i--)

#define REVV(i,l,r,c) for(int i=l;i>=r;i-=c)

#define REV(i,l,r) REVV(i,l,r,1)

//random

int irand(int lo, int hi){

    return (((double)rand())/(RAND_MAX+1.0)) * (hi-lo+1) + lo;

}

//ll to string

string toString(ll x) {

    stringstream ss;

    ss << x;

    return ss.str();

}

//string to ll

ll toNumber(string S) {

    ll ret;

    sscanf(S.c_str(),"%lld",&ret);

    return ret;

}

// std::fill(start, end, value);

// for(auto it: DS){}



const int INF=(int)2e9;

const ll MOD=(ll)1e9+7;

/*==========================================================*/

/*                     END OF TEMPLATE                      */

/* DOMINUS pascit me, et nihil mihi deerit (Psalmorum 23:1) */

/*==========================================================*/



ll f(ll n, ll mult){

    return n / mult;

}



int main(){

    ll a,b,c,d; scanf("%lld %lld %lld %lld", &a, &b, &c, &d);

    ll lcm = c * d / __gcd(c,d);

    ll range = b - a + 1;

    ll mult_c = f(b,c) - f(a-1,c);

    ll mult_d = f(b,d) - f(a-1,d);

    ll mult_cd = f(b,lcm) - f(a-1,lcm);

    printf("%lld\n", range - mult_c - mult_d + mult_cd);

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.233029307190027x):
#include<stdio.h>

#include<string.h>

#include<algorithm>

using namespace std;

long long a,b,c,d;

int main(){

   while(~scanf("%lld%lld%lld%lld",&a,&b,&c,&d)){

       long long s=0,t1,t2;

       t1=b/c-a/c;

       if(a%c==0)

        t1++;

        t2=b/d-a/d;

        if(a%d==0)

            t2++;

        s=t1+t2;

        long long p;

        p=__gcd(c,d);

        p=c*d/p;

        s-=b/p-a/p;

        if(a%p==0)

            s--;

            s=(b-a+1)-s;

        printf("%lld\n",s);

   }

}
// Slower C++ solution:
//

/*==========================================================*/

/*    Template ver 2017-0720    |    Created by JollyBee    */

/* DOMINUS pascit me, et nihil mihi deerit (Psalmorum 23:1) */

/*==========================================================*/

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

typedef unsigned long long ull;

typedef vector<int> vi;

typedef pair<int,int> pii;

typedef pair<ll,ll> pll;

typedef vector<pii> vii;

const double EPS=(double)1e-9;

const double PI=(double)acos(-1.0);

#define fi first

#define se second

#define mp make_pair

#define pb push_back

#define pob pop_back

#define pf push_front

#define pof pop_front

#define FOR(i,n) for(int i=0;i<n;i++)

#define REPP(i,l,r,c) for(int i=l;i<=r;i+=c)

#define REP(i,l,r) REPP(i,l,r,1)

#define FORD(i,n) for(int i=n-1;i>=0;i--)

#define REVV(i,l,r,c) for(int i=l;i>=r;i-=c)

#define REV(i,l,r) REVV(i,l,r,1)

//random

int irand(int lo, int hi){

    return (((double)rand())/(RAND_MAX+1.0)) * (hi-lo+1) + lo;

}

//ll to string

string toString(ll x) {

    stringstream ss;

    ss << x;

    return ss.str();

}

//string to ll

ll toNumber(string S) {

    ll ret;

    sscanf(S.c_str(),"%lld",&ret);

    return ret;

}

// std::fill(start, end, value);

// for(auto it: DS){}



const int INF=(int)2e9;

const ll MOD=(ll)1e9+7;

/*==========================================================*/

/*                     END OF TEMPLATE                      */

/* DOMINUS pascit me, et nihil mihi deerit (Psalmorum 23:1) */

/*==========================================================*/



ll f(ll n, ll mult){

    return n / mult;

}



int main(){

    ll a,b,c,d; scanf("%lld %lld %lld %lld", &a, &b, &c, &d);

    ll lcm = c * d / __gcd(c,d);

    ll range = b - a + 1;

    ll mult_c = f(b,c) - f(a-1,c);

    ll mult_d = f(b,d) - f(a-1,d);

    ll mult_cd = f(b,lcm) - f(a-1,lcm);

    printf("%lld\n", range - mult_c - mult_d + mult_cd);

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.232973159005357x):
#include<cstdio>

#include<cstring>

using namespace std;

typedef long long ll;

ll gcd(ll a,ll b)

{

	return b==0?a:gcd(b,a%b);

}

ll lcm(ll a,ll b)

{

	return a*b/gcd(a,b);

}

int main(){

	ll a,b,c,d;

	while(~scanf("%lld%lld%lld%lld",&a,&b,&c,&d)){

		ll lcmm=lcm(c,d);

		ll sum=b/c-(a-1)/c+b/d-(a-1)/d-(b/lcmm-(a-1)/lcmm);	//a,b中能整除 

		ll ans=b-a+1-sum;

		printf("%lld\n",ans);

	}

	return 0;

}
// Slower C++ solution:
//Assalamualaikum//

//Mahmudul Ahsan Mahi

//RUET CSE 19'





#include<iostream>

#include<cstdio>

#include <bits/stdc++.h>

#include<cstring>

#include<vector>

#include<list>

#include<stack>

#include<iterator>

#include<algorithm>

#include<cstdlib>



#define ll long long

#define ull unsigned long long

#define pi acos(-1)



using namespace std;



int main()

{

    stack<int>st[1001];



    int i, n, q, o, t, x;



    cin>>n>>q;



    while(q--){

        cin>>o;



        if(o==0){

            cin>>t>>x;

            st[t].push(x);

        }



        else if(o==1){

            cin>>t;

            if(st[t].empty())

                ;

            else{

                cout<<st[t].top()<<endl;

            }

        }



        else if(o==2){

            cin>>t;

            if(st[t].empty())

                ;

             else{

                st[t].pop();

             }





        }

    }





    return 0;

}






// Faster C++ solution for the same problem (measured speedup: 1.2959003698276386x):
#include<bits/stdc++.h>

using namespace std;

int main ()

{

     signed long long x,a,q,y,z,n,t;

    cin>>n;

    cin>>q;

    getchar();

    stack<int>S[n];

    stack<int>S2[n];

     for(int i=1; i<=q; i++)

    {

        cin>>a;

        if(a==0)

        {

            cin>>t;

            cin>>x;

            S[t].push(x);

        }

        else if(a==1)

        {

            cin>>t;

            //cout<<"S[t] = ";

            if(!S[t].empty())

            {

          cout<<S[t].top()<<endl;

            S2[t].push(S[t].top());

            S2[t].pop();

            }

        }

        else if(a==2)

        {

            cin>>t;

            if(!S[t].empty())

            {

                S[t].pop();

            }

        }

    }

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<cmath>

#include<cstring>

#include<cstdlib>

#include<ctime>

#include<cstdio>

#include<string>

//#include<string>

//#include<sstream>

using namespace std;



int main()

{

	long long a[100000],i;

	long long num=0;

	i=1;

	while(num<=1000000000){

		num+=i;

		a[i]=num;

		i++;

	}

	int sum=i;

	int x;

	scanf("%d",&x);

	for(i=1;i<=sum;i++){

		if(x<=a[i]){

			printf("%d\n",i);

			break;

		}

	}

}

// Faster C++ solution for the same problem (measured speedup: 1.3651376408233669x):
#include <iostream>

using namespace std;

#define ll long long

int main()

{

	ll x;

	cin>>x;

	int i=1;

	ll sum=0;

	while(sum<x)

	{

		sum=sum+i;

		i++;

	}

	cout<<i-1;

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<cmath>

#include<cstring>

#include<cstdlib>

#include<ctime>

#include<cstdio>

#include<string>

//#include<string>

//#include<sstream>

using namespace std;



int main()

{

	long long a[100000],i;

	long long num=0;

	i=1;

	while(num<=1000000000){

		num+=i;

		a[i]=num;

		i++;

	}

	int sum=i;

	int x;

	scanf("%d",&x);

	for(i=1;i<=sum;i++){

		if(x<=a[i]){

			printf("%d\n",i);

			break;

		}

	}

}

// Faster C++ solution for the same problem (measured speedup: 1.378141065346708x):
#include <stdio.h>

#include <string.h>

#include <math.h>

#include <iostream>

#include <algorithm>

#include <vector>

#include <queue>

#include <set>

#include <map>

#include <unordered_map>

using namespace std;

typedef long long ll;

const int maxn = 1e5 + 10;



#define dbg(x1) cout<<#x1<<" = "<<(x1)<<endl

#define dbg2(x1,x2) cout<<#x1<<" = "<<(x1)<<" "<<#x2<<" = "<<(x2)<<endl

#define dbg3(x1,x2,x3) cout<<#x1<<" = "<<(x1)<<" "<<#x2<<" = "<<(x2)<<" "<<#x3<<" = "<<(x3)<<endl



int main() {

    //freopen(".in", "r", stdin);

    int n;

    scanf("%d",&n);

    ll sum=0;

    for(int i=1;;i++)

    {

        sum+=i;

        if(sum>=n) return 0*printf("%d\n",i);

    }

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

using namespace std;

typedef long long ll;

const int maxn = 1e5 + 7;

ll a[maxn];

int aim, ans = 0;

int main()

{

    ios::sync_with_stdio(false);

    cin.tie(0), cout.tie(0);

    for(int i = 1; i < maxn; i++) a[i] = a[i-1] + i;

    cin>>aim;

    while(a[ans] < aim) ans++;

    cout<<ans<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.8403988152042199x):
#include <stdio.h>

#include <string.h>

#include <math.h>

#include <iostream>

#include <algorithm>

#include <vector>

#include <queue>

#include <set>

#include <map>

#include <unordered_map>

using namespace std;

typedef long long ll;

const int maxn = 1e5 + 10;



#define dbg(x1) cout<<#x1<<" = "<<(x1)<<endl

#define dbg2(x1,x2) cout<<#x1<<" = "<<(x1)<<" "<<#x2<<" = "<<(x2)<<endl

#define dbg3(x1,x2,x3) cout<<#x1<<" = "<<(x1)<<" "<<#x2<<" = "<<(x2)<<" "<<#x3<<" = "<<(x3)<<endl



int main() {

    //freopen(".in", "r", stdin);

    int n;

    scanf("%d",&n);

    ll sum=0;

    for(int i=1;;i++)

    {

        sum+=i;

        if(sum>=n) return 0*printf("%d\n",i);

    }

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<cmath>

#include<cstring>

#include<cstdlib>

#include<ctime>

#include<cstdio>

#include<string>

//#include<string>

//#include<sstream>

using namespace std;



int main()

{

	long long a[100000],i;

	long long num=0;

	i=1;

	while(num<=1000000000){

		num+=i;

		a[i]=num;

		i++;

	}

	int sum=i;

	int x;

	scanf("%d",&x);

	for(i=1;i<=sum;i++){

		if(x<=a[i]){

			printf("%d\n",i);

			break;

		}

	}

}

// Faster C++ solution for the same problem (measured speedup: 1.3454284382306891x):
				/*****************************************************

 				*	Logged in : HABIBUR RAHMAN						 *

				*	Dept	  : COMPUTER SCIENCE AND ENGINEERING	 *

				*													 *

				*	KHULNA UNIVERSITY OF ENGINEERING AND TECHNOLOGY  *

				******************************************************/





#include<bits/stdc++.h>

using namespace std;

typedef long long int ll;

typedef unsigned long long int ull;

typedef long double ld;

typedef vector<int> vi;

typedef vector<ll> vll;

typedef vector<ull> vull;

typedef vector<string> vs;

typedef pair<ll,ll> pll;

#define fast_io 			ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

#define all(v) 				v.begin(),v.end()

#define allr(v) 			v.rbegin(),v.rend()

#define rep(i,a,b) 			for(ll i=a;i<=b;i++)

#define rep0(i,n)			for(ll i=0;i<n;i++)

#define rrep0(i, n) 		for(ll i=(ll)(n);i>0;--i)

#define rrep(i, a, b) 		for(ll i=(ll)(a);i>=(ll)(b);--i)

#define pb(z) 				push_back(z)

#define ff					first

#define ss 					second

#define caset 				int t;cin>>t;for(int tt=1;tt<=t;tt++)

#define sz(X) 				((ll)(X).size())

#define scan(X) 			scanf("%s", (X))

#define ms(v,val)			memset((v),(val),sizeof((v)))

#define ms0(X) 				memset((X), 0, sizeof((X)))

#define ms1(X) 				memset((X), -1, sizeof((X)))

#define m_p(a,b)            make_pair(a,b)

#define get_pos(c,x) 		(lower_bound(c.begin(),c.end(),x)-c.begin())

#define lcm(a,b)            (a*b)/__gcd(a,b)

#define INF9                1000000010

#define INF18               4000000000000000010

#define bpll(a)             __builtin_popcountll(a)

#define sqr(a)              ((a)*(a))

#define nl					"\n"

#define mod					1e9+7;

#define mx_el(v)			*max_element(all(v));

#define mn_el(v)			*min_element(all(v));

#define pcase(z,x)    		cout<<"Case "<<z<<": "<<x<<"\n"

const double pi = 2*acos(0) ;

#define display(v)			vi :: iterator it;for(it=(v).begin();it!=(v).end();it++){cout << *it << " " ;}cout << endl;

#define taking(n,v) 		for(ll i=0;i<(n);i++){ll inp;cin>>inp;(v).push_back(inp);}



void start(){

      #ifndef ONLINE_JUDGE 

      freopen("input.txt" , "r" , stdin) ;

      freopen("output.txt" , "w" , stdout) ;

      #endif

}

bool is(string s1,string s2){

	if(sz(s1)!=sz(s2))return false;

	rep0(i,sz(s1)){

		if(s1[i]!='.'){

			if(s1[i]!=s2[i]){

				return false;

			}

		}

	}

	return true;

}

void solve()

{

 	 ll n,cnt=0,i=1;cin>>n;

 	 while(n>0){

 	 	n-=i;

 	 	cnt++;

 	 	i++;

	  }

	  cout << cnt ;

}

int main() {

	fast_io

	//start();

    //caset{

    	//cout << "Case " << tt << ": ";

		  solve();

	//}

	

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

using namespace std;

typedef long long ll;

const int maxn = 1e5 + 7;

ll a[maxn];

int aim, ans = 0;

int main()

{

    ios::sync_with_stdio(false);

    cin.tie(0), cout.tie(0);

    for(int i = 1; i < maxn; i++) a[i] = a[i-1] + i;

    cin>>aim;

    while(a[ans] < aim) ans++;

    cout<<ans<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.7967136789722529x):
				/*****************************************************

 				*	Logged in : HABIBUR RAHMAN						 *

				*	Dept	  : COMPUTER SCIENCE AND ENGINEERING	 *

				*													 *

				*	KHULNA UNIVERSITY OF ENGINEERING AND TECHNOLOGY  *

				******************************************************/





#include<bits/stdc++.h>

using namespace std;

typedef long long int ll;

typedef unsigned long long int ull;

typedef long double ld;

typedef vector<int> vi;

typedef vector<ll> vll;

typedef vector<ull> vull;

typedef vector<string> vs;

typedef pair<ll,ll> pll;

#define fast_io 			ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

#define all(v) 				v.begin(),v.end()

#define allr(v) 			v.rbegin(),v.rend()

#define rep(i,a,b) 			for(ll i=a;i<=b;i++)

#define rep0(i,n)			for(ll i=0;i<n;i++)

#define rrep0(i, n) 		for(ll i=(ll)(n);i>0;--i)

#define rrep(i, a, b) 		for(ll i=(ll)(a);i>=(ll)(b);--i)

#define pb(z) 				push_back(z)

#define ff					first

#define ss 					second

#define caset 				int t;cin>>t;for(int tt=1;tt<=t;tt++)

#define sz(X) 				((ll)(X).size())

#define scan(X) 			scanf("%s", (X))

#define ms(v,val)			memset((v),(val),sizeof((v)))

#define ms0(X) 				memset((X), 0, sizeof((X)))

#define ms1(X) 				memset((X), -1, sizeof((X)))

#define m_p(a,b)            make_pair(a,b)

#define get_pos(c,x) 		(lower_bound(c.begin(),c.end(),x)-c.begin())

#define lcm(a,b)            (a*b)/__gcd(a,b)

#define INF9                1000000010

#define INF18               4000000000000000010

#define bpll(a)             __builtin_popcountll(a)

#define sqr(a)              ((a)*(a))

#define nl					"\n"

#define mod					1e9+7;

#define mx_el(v)			*max_element(all(v));

#define mn_el(v)			*min_element(all(v));

#define pcase(z,x)    		cout<<"Case "<<z<<": "<<x<<"\n"

const double pi = 2*acos(0) ;

#define display(v)			vi :: iterator it;for(it=(v).begin();it!=(v).end();it++){cout << *it << " " ;}cout << endl;

#define taking(n,v) 		for(ll i=0;i<(n);i++){ll inp;cin>>inp;(v).push_back(inp);}



void start(){

      #ifndef ONLINE_JUDGE 

      freopen("input.txt" , "r" , stdin) ;

      freopen("output.txt" , "w" , stdout) ;

      #endif

}

bool is(string s1,string s2){

	if(sz(s1)!=sz(s2))return false;

	rep0(i,sz(s1)){

		if(s1[i]!='.'){

			if(s1[i]!=s2[i]){

				return false;

			}

		}

	}

	return true;

}

void solve()

{

 	 ll n,cnt=0,i=1;cin>>n;

 	 while(n>0){

 	 	n-=i;

 	 	cnt++;

 	 	i++;

	  }

	  cout << cnt ;

}

int main() {

	fast_io

	//start();

    //caset{

    	//cout << "Case " << tt << ": ";

		  solve();

	//}

	

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<cmath>

#include<cstring>

#include<cstdlib>

#include<ctime>

#include<cstdio>

#include<string>

//#include<string>

//#include<sstream>

using namespace std;



int main()

{

	long long a[100000],i;

	long long num=0;

	i=1;

	while(num<=1000000000){

		num+=i;

		a[i]=num;

		i++;

	}

	int sum=i;

	int x;

	scanf("%d",&x);

	for(i=1;i<=sum;i++){

		if(x<=a[i]){

			printf("%d\n",i);

			break;

		}

	}

}

// Faster C++ solution for the same problem (measured speedup: 1.348059809102749x):
#include<bits/stdc++.h>

using namespace std;

#define Q int tc; scanf("%d",&tc);cin.ignore(); for(int q=1;q<=tc;q++)

typedef long long int ll;

#define MAX 100000



int main()

{

    ll x;

    cin>>x;

    double ans=(-1+sqrt(1+8*x))/2;

    cout<<ceil(ans);

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

using namespace std;

typedef long long ll;

const int maxn = 1e5 + 7;

ll a[maxn];

int aim, ans = 0;

int main()

{

    ios::sync_with_stdio(false);

    cin.tie(0), cout.tie(0);

    for(int i = 1; i < maxn; i++) a[i] = a[i-1] + i;

    cin>>aim;

    while(a[ans] < aim) ans++;

    cout<<ans<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.8002276674579551x):
#include<bits/stdc++.h>

using namespace std;

#define Q int tc; scanf("%d",&tc);cin.ignore(); for(int q=1;q<=tc;q++)

typedef long long int ll;

#define MAX 100000



int main()

{

    ll x;

    cin>>x;

    double ans=(-1+sqrt(1+8*x))/2;

    cout<<ceil(ans);

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define _C ios::sync_with_stdio(false);cin.tie(0);

#define xx first

#define yy second

#define ERR 0.00000001

#define INF (ll)1<<62

#define nSize 1000000

#define forn for(int i = 0 ; i < n ; i++)

using namespace std;

typedef long long ll;

typedef pair<ll,ll> pll;

typedef vector<ll> vll;

typedef vector<pll> vpll;

typedef complex<double> cp;

typedef vector<cp> polinomio;

typedef long double ld;

const ld PI = acos(-1);





int main()

{_C

	ll n , k;

	ll mx = INF;

	cin >> n >> k;

	vll v(n);

	forn

		cin >> v[i];

	sort(v.begin(),v.end());

	for(int i = k-1 ; i < n ; i++)

	{

		mx = min(v[i]-v[i-k+1],mx);

	}

	cout << mx << '\n';

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.518456423904918x):
#include <cstdio>

#include <cctype>

#include <algorithm>



int n, k, ans = 0x7fffffff;

int a[100010];



int read() {

    int ret, f = 1;

    char ch;

    while(!isdigit(ch = getchar())) (ch == '-') && (f = -1);

    for(ret = ch - '0'; isdigit(ch = getchar()); ret *= 10, ret += ch - '0');

    return ret * f;

}



void print(int x) {

    if(x < 0) putchar('-'), x = -x;

    if(x > 9) print(x / 10);

    putchar(x % 10 + '0');

}



int main() {

    n = read(), k = read();

    for(int i = 1; i <= n; ++i) a[i] = read();

    std::sort(a + 1, a + n + 1);

    for(int i = 1; i + k - 1 <= n; ++i) ans = std::min(ans, a[i + k - 1] - a[i]);

    print(ans);

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int arr[2000005];

int main()

{

    int i,j,m,n,t,ans,tem;

    cin>>n>>m;

    for(i=1; i<=n; i++)

        cin>>arr[i];



    sort(arr+1,arr+n+1);

    ans=1000000007;

    for(i=m; i<=n; i++)

    {

        if((arr[i]-arr[i-m+1])<ans)

            ans=arr[i]-arr[i-m+1];

    }

    cout<<ans<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.40286686640561x):
#include <cstdio>

#include <cctype>

#include <algorithm>



int n, k, ans = 0x7fffffff;

int a[100010];



int read() {

    int ret, f = 1;

    char ch;

    while(!isdigit(ch = getchar())) (ch == '-') && (f = -1);

    for(ret = ch - '0'; isdigit(ch = getchar()); ret *= 10, ret += ch - '0');

    return ret * f;

}



void print(int x) {

    if(x < 0) putchar('-'), x = -x;

    if(x > 9) print(x / 10);

    putchar(x % 10 + '0');

}



int main() {

    n = read(), k = read();

    for(int i = 1; i <= n; ++i) a[i] = read();

    std::sort(a + 1, a + n + 1);

    for(int i = 1; i + k - 1 <= n; ++i) ans = std::min(ans, a[i + k - 1] - a[i]);

    print(ans);

    return 0;

}