Program HOC24;
var d,i,k: integer;
a: array[1..1000] 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;
begin
write('Nhap K: '); readln(k);
for i:=1 to k do
begin
write('A[',i,']='); readln(a[i]);
end;
d:=0;
for i:=1 to k do if nt(a[i]) then d:=d+1;
write('Co ',d,' so nguyen to trong mang A');
readln
end.