uses crt;
var a:array[1..1000]of integer;
i,n,t,t1,dem,dem1:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
t:=0;
t1:=0;
dem:=0;
dem1:=0;
for i:=1 to n do
begin
if a[i] mod 2=0 then
begin
t:=t+a[i];
inc(dem);
end
else begin
t1:=t1+a[i];
inc(dem1);
end;
end;
writeln('So luong so chan la: ',dem);
writeln('Tong cac so chan la: ',t);
writeln('So luong so le la: ',dem1);
writeln('Tong cac so le la: ',t1);
readln;
end.