program hanhuota;
var
n,m,i,j,k:longint;
f:array[0..200,1..30]of int64;
begin
assign (input,'ionah.in');
reset (input);
assign (output,'ionah.out');
rewrite (output);
readln (n,m);
for i:=0 to m do
for j:=1 to n do
f[i,j]:=maxlongint;
for i:=2 to n do
f[1,i]:=1;
for i:=2 to m do
for j:=3 to n do
for k:=1 to i do
if (f[k,j]<>maxlongint)and(f[i-k,j-1]<>maxlongint) then
if f[k,j]*2+f[i-k,j-1]<f[i,j] then
f[i,j]:=f[k,j]*2+f[i-k,j-1];
writeln (f[m,n]);
close (input);
close (output)
end.