uses crt;
var a:array[1..250]of integer;
i,n,t,dem:integer;
begin
clrscr;
write('n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']'); readln(a[i]);
end;
{------------------------------xu-ly---------------------------}
dem:=0;
t:=0;
for i:=1 to n do
if a[i] mod 3=0 then
begin
inc(dem);
t:=t+a[i];
end;
writeln('so phan tu la boi cua 3 trong day nay la: ',dem);
writeln('tong cua cac phan tu la boi cua 3 trong day nay la: ',t);
readln;
end.