uses crt;
var a,b,c:array[1..1000]of integer;
i,n,dem:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
dem:=0;
for i:=1 to n do
if (a[i] mod 3=0) and (a[i] mod 5=0) then inc(dem);
writeln(dem);
readln;
end.