#include<bits/stdc++.h>
using namespace std;
#define R register
const int maxn=10005,INF=0x3f3f3f3f;
int h,n;
int dp[maxn][20];
int main()
{
freopen("eggs.in","r",stdin);
freopen("eggs.out","w",stdout);
scanf("%d%d",&h,&n);
for(R int i=1;i<=h;i++)
{
dp[i][1]=i;
for(R int j=2;j<=n;j++)
{
dp[i][j]=INF;
for(R int k=1;k<=i;k++)
{
dp[i][j]=min(dp[i][j],max(dp[k-1][j-1],dp[i-k][j])+1);
}
}
}
printf("%d\n",dp[h][n]);
return 0;
}