uses crt;
var a:array[1..250]of integer;
n,i,t,t1,t2:integer;
begin
clrscr;
repeat
write('n='); readln(n);
until (0<n) and (n<=250);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
t:=0;
for i:=1 to n do
t:=t+a[i];
writeln('tong cac so nguyen la: ',t);
t1:=0;
for i:=1 to n do
if a[i]>0 then t1:=t1+a[i];
writeln('tong cac so nguyen duong la: ',t1);
t2:=0;
for i:=1 to n do
if a[i]<0 then t2:=t2+a[i];
writeln('tong cac so nguyen am la: ',t2);
readln;
end.