#include<bits/stdc++.h>
using namespace std;
#define mx 1000007
#define ll long long int
typedef pair<ll,ll>pii;



ll a[mx];
int main()
{

    //seive();
    for(int i=1;i<=1000;i++){
        ll x=(i*(i+1))/2;
        a[i]=x;
    }
    ll n,m;
    cin>>n>>m;
    int x,y;
    for(int i=1000;i>=1;i--){
        if(a[i]<=n){
            x=i;
            break;
        }
    }
    for(int i=1000;i>=1;i--){
        if(a[i]<=m){
            y=i;
            break;
        }
    }
    cout<<y-x+1<<endl;


}
