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