var
a:array[1..100] of real;
i,n,last:integer;
s:real;
input,output:text;
begin
assign (input,'input.txt');
assign (output,'output.txt');
reset (input);
rewrite (output);
readln(n);
for i:=1 to n do begin
read(input,a[i]);
if (a[i] >= 0) then last:=i;end;
for i:=1 to last-1 dos:=s+a[i];
write(output,s:5:3);
close (input);
close (output);
end.