Program PP2;
Var f:array[1..20,1..20]of qword;
a:array[1..20]of qword;
i,n,k,j:longint;
Begin
assign(input,'k.in'); reset(input);
assign(output,'k.out'); rewrite(output);
a[1]:=1;
for i:=2 to 20 do a[i]:=a[i-1]*i;
readln(n,k);
f[1,1]:=1;
f[2,1]:=1; f[2,2]:=1;
for i:=3 to n do begin
f[i,1]:=1;
f[i,i]:=1;
for j:=2 to i-1 do f[i,j]:=f[i-1,j]+f[i-1,j-1]+a[i-1];
end;
writeln(f[n,k]);
close(input);
close(output);
End.