program super_mario;
var a:array[1..10] of integer;
    i,x,zbroj:integer;
begin
for i:=1 to 10 do begin
readln(a[i]);
zbroj:=zbroj+a[i];
if zbroj<=100 then x:=zbroj;
end;
zbroj:=0;
for i:=1 to  10 do begin
zbroj:=zbroj+a[i];
if abs(100-x)=abs(100-zbroj) then begin
if zbroj>x then x:=zbroj;
end;
end;
writeln(x);
end.
