Program HOC24;
const fi='SONGUYEN.TXT';
fo='KETQUA.TXT';
var n,i,d:integer;
a: array[1..32000] of integer;
function nt(x: integer): boolean;
var j: integer;
begin
nt:=true;
if (x=2) or (x=3) then exit;
nt:=false;
if (x=1) or (x mod 2=0) or (x mod 3=0) then exit;
j:=5;
while j<=trunc(sqrt(x)) do
begin
if (x mod j=0) or (x mod (j+2)=0) then exit;
j:=j+6;
end;
nt:=true;
end;
procedure ip;
begin
assign(f,fi);
reset(f);
readln(f,n);
for i:=1 to n do read(f,a[i]);
close(f);
end;
procedure out;
begin
assign(f,fo);
rewrite(f);
d:=0;
for i:=1 to n do
if nt(a[i]) then inc(d);
write(f,d);
close(f);
end;
begin
ip;
out;
end.