var
flag : boolean;
i, s : integer;
a : array [1..20] of integer;
begin
for i := 1 to 20 do read (a[i]);
s := 0; flag := false;
for i := 1 to 20 do
if flag then s := s + a[i]
else if a[i] < 0 then flag := true;
writeln (s);
end.
var
flag : boolean;
i, s : integer;
a : array [1..20] of integer;
begin
for i := 1 to 20 do read (a[i]);
s := 0; flag := false;
for i := 1 to 20 do
if flag then s := s + a[i]
else if a[i] < 0 then flag := true;
writeln (s);
end.