program tongamduong;
var i,n:integer;
ta,td,dema,demd:integer;
a:array[1..100] of integer;
begin
write('nhap vao n=');readln(n);
ta:=0;td:=0;dema:=0;demd:=0;
for i:=1 to n do
begin
writeln('nhap vao day so ',i,'=');readln(a[i]);
end;
for i:=1 to n do
if a[i]>0 then
begin
td:=td+a[i];
demd:=demd+1;
end;
writeln(' tong cac so duong =',td:4);
writeln(' tong so phan tu duong=',demd:4);
if a[i]<0 then
begin
ta:=ta+a[i];
dema:=dema+1;
end;
writeln(' tong cac so am =',ta:4);
writeln(' tong so phan tu am=',dema:4);
readln
end.