Program n1;
const nn=30000;
var
m: array [1..nn,1..nn] of integer;
i,j,k,n:integer;
begin
k:=0;
writeln('Введите n'); readln(n);
writeln('Введите массив');
for i:=1 to n do
for j:=1 to n do begin
read(m[i,j]);
if (m[i,j] mod 3 =0) then k:=k+1;
end;
writeln(k);
end.