program ex;
type
sz=array[1..10000]of longint;
ss=array[1..2000]of integer;
var
a,c,d:sz;
z:ss;
f1,f2:text;
i:integer;
n,k:integer;
step:integer;
j,t,w:integer;
time:integer;
procedure init;
var
i:integer;
begin
assign(f1,'choose.in');
assign(f2,'choose.out');
reset(f1);
rewrite(f2);
read(f1,n,k);
readln(f1);
for i:=1 to n do read(f1,a[i]);
end;
procedure pd(c:sz);
var
t:integer;
begin
t:=0;
for i:=1 to k do t:=t+c[i];
d[w]:=t;
end;
procedure zh(step,j:integer);
var
i:integer;
begin
for i:=j to n do
begin
c[step]:=a[i];
j:=i;
if step<k then zh(step+1,j+1)
else begin
inc(w);
pd(c);
end;
end;
end;
procedure zs;
var
i,t,j,w:integer;
begin
w:=0;
j:=0;
for i:=2 to 10000 do
begin
t:=0;
for j:=1 to trunc(sqrt(i)) do
if (i mod j=0) then inc(t);
if t=1 then
begin
inc(w);
z[w]:=i;
end;
end;
end;
procedure s(x:integer);
var
i,t:integer;
begin
t:=0;
for i:=1 to 10000 do
begin
if (x mod z[i]=0) then t:=t+1;
end;
if t=0 then inc(time);
end;
begin
init;
w:=0;j:=0;
time:=0;
zh(1,1);
zs;
for i:=1 to w do s(d[i]);
writeln(f2,time);
close(f1);
close(f2);
end.