#include<iostream>using namespace std;int main(){ int n,m,s=0,x,i; while(cin>>n>>m) { if(n<m) { while(s<m) { i=0; x=n+i; s+=x; i+=1; } cout<<x-n+1<<endl; } else { cout<<0<<endl; } } return 0;}