program ct;
uses crt;
var i,n,S,d1,d2,tongchan,tongle,Max,Min:integer;
A:array[1..100] of integer;
begin
clrscr;
write('nhap n:=');readln(n);
for i:=1 to n do
begin
write('nhap mang A[',i,']:=');readln(A[i]);
end;
d1:=0; d2:=0; Max:=A[1]; Min:=A[1]; tongchan:=0; tongle:=0; S:=0;
for i:=1 to n do
begin
if A[i] mod 2=0 then d1:=d1+1;
if A[i] mod 2=1 then d2:=d2+1;
if Max<A[i] then Max:=A[i];
if Min>A[i] then Min:=A[i];
if A[i] mod 2=0 then tongchan:=tongchan+A[i] else tongle:=tongle+A[i];
S:=S+A[i];
end;
write('KET QUA');
writeln('co',d1,' la so chan');
writeln('co',d2,' la sole');
writeln('gia tri lon nhat la:',Max);
writeln('gia tri nho nhat la:',Min);
writeln('tong so chan la:',tongchan);
writeln('tong so le la:',tongle);
writeln('tong la:',S);
readln
end.