#include <bits/stdc++.h>
using namespace std;
int f[40010][22],m,n;
int main(){
freopen("eagleegg.in","r",stdin);
freopen("eagleegg.out","w",stdout);
for (int i=1;i<=40000;i++) f[i][1]=i;
for (int i=1;i<20;i++) f[1][i]=1;
for (int i=2;i<=40000;i++) {
for (int j=2;j<=20;j++) {
f[i][j]=f[i-1][j-1]+f[i-1][j]+1;
}
}
while(cin >> m >> n){
if (m==0&&n==0){
return 0;
}else{
if (m>19) {
m=19;
}
for (int i=1;i<=40000;i++){
if (f[i][m]>=n) {
printf("%d\n",i);
break;
}
}
}
}
return 0;
}