program boi_cua_3;
uses crt;
var a:array[1..100] of integer;
n,i:byte;
s:integer;
begin
clrscr;
write('nhap so luong phan tu cua mang: ');
readln(n);
for i:= 1 to n do
begin
write('nhap phan tu thu [',i,']= ');
readln(a[i]);
end;
s:=0;
for i:= 1 to n do
if a[i] mod 3 = 0 then s:=s+a[i];
writeln('vay tong cac so la boi cua 3 la: ',s);
readln;
end.