#include <bits/stdc++.h>
using namespace std;
int n,h,res=1010;
void dfs (int idx,int h,int ans) {
if (idx==n||h==0) {
ans+=h;
res=min(ans,res);
}
for (int i=h;i>=1;i--) {
if (ans+h/i>=res) break;
dfs(idx+1,i-1,ans+h/i);
}
}
int main () {
freopen("eagleegg.in","r",stdin);
freopen("eagleegg.out","w",stdout);
while (cin >> n >> h) {
if (n==0&&h==0) break;
dfs(1,h,0);
cout << res <<endl;
}
return 0;
}