program hedianzhanwenti;
var
f:array[1..50,0..5]of int64;
i,j,k,n,m:longint;
sum:int64;
begin
assign (input,'nucle.in');
reset (input);
assign (output,'nucle.out');
rewrite (output);
readln (n,m);
f[1,0]:=1;
f[1,1]:=1;
for i:=2 to n do
begin
for j:=0 to m-1 do
f[i,0]:=f[i,0]+f[i-1,j];
for j:=1 to m-1 do
if i-j>=0 then
f[i,j]:=f[i-1,j-1]
end;
for i:=0 to m-1 do
sum:=sum+f[n,i];
writeln (sum);
close (input);
close (output)
end.