Program HOC24;
var a: array[1..1000] of integer;
i,n : integer;
t: longint;
begin
write('Nhap N: '); realdn(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
t:=0;
for i:=1 to n do if a[i] mod 3 = 0 then t:=t+a[i];
write('Tong cac so la boi cua 3 trong danh sach la: ',t);
readln
end.