program tinhtong;
uses crt;
var A:array[1..100] of integer;
n,i,tongc,tongl:integer;
begin
write('Nhap so luong phan tu N: '); readln(n);
tongc:=0; tongl:=0;
for i:=1 to n do
begin
write('Phan tu thu ',i,': '); readln(A[i]);
if (i mod 2=0) and (A[i] mod 2=0) then tongc:=tongc+A[i];
if (i mod 2=1) and (A[i] mod 2=1) then tongl:=tongl+A[i];
end;
writeln('Tong cac phan tu chan o vi tri chan la: ',tongc);
writeln('Tong cac phan tu le vi tri le la: ',tongl);
readln
end.