#include <iostream>
#include <cmath>
using namespace std;
int f(unsigned int a, unsigned int m){
int n = 0;
if(m - 2*a != 0){
n ++;
f(a+1, m - a);
}
else{
n ++;
return n;
}
}
int main() {
int n, a, m;
cin>>a>>m;
cout<<f(a, m);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgZih1bnNpZ25lZCBpbnQgYSwgdW5zaWduZWQgaW50IG0pewoJaW50IG4gPSAwOwoJaWYobSAtIDIqYSAhPSAwKXsKICAgICAgICBuICsrOwogICAgICAgIGYoYSsxLCBtIC0gYSk7IAoJfQoJZWxzZXsKCQluICsrOwogICAgICAgIHJldHVybiBuOwoJfQp9CmludCBtYWluKCkgewoJaW50IG4sIGEsIG07CgljaW4+PmE+Pm07Cgljb3V0PDxmKGEsIG0pOwoJcmV0dXJuIDA7Cn0=