uses crt;
var a:array[1..100]of integer;
i,n,t,dem:integer;
begin
clrscr;
readln(n);
for i:=1 to n do readln(a[i]);
dem:=0;
t:=0;
for i:=1 to n do
begin
if a[i] mod 3=0 then dem:=dem+1;
end;
for i:=1 to n do t:=t+a[i];
writeln('So phan tu chia het cho 3 la: ' ,dem);
writeln('Tong cac so la: ',t);
readln;
end.