program nucle;
var
ans,n,m:longint;
f1,f2:text;
procedure init;
begin
assign(f1,'nucle.in'); reset(f1);
assign(f2,'nucle.out'); rewrite(f2);
readln(f1,n,m);
close(f1);
ans:=0;
end;
function aa(x,y:longint):longint;
var i,temp:longint;
begin
temp:=1;
i:=y;
while i>0 do begin
temp:=temp*x;
x:=x-1;
i:=i-1;
end;
aa:=temp;
end;
function cc(x,y:longint):longint;
begin
cc:=aa(x,y) div aa(y,y);
end;
procedure play;
var i:longint;
begin
for i:=1 to m-1 do ans:=ans+cc(n,i);
for i:=m to n-1 do ans:=ans+(cc(n,i)-(n-i+1));
end;
begin
init;
play;
writeln(f2,ans+1);
close(f2);
end.