program ssa;
var
a:array[1..15]of integer;
i,n,b,m:integer; c:real;
begin
assign(input,'save.in');
reset(input);
assign(output,'save.out');
rewrite(output);
for i:=1 to 12 do
read(a[i]);
for i:=1 to 12 do
begin
n:=n+300-a[i];
if n>99 then begin m:=(n div 100)*100; b:=b+m; n:=n-m; end;
if n<0 then begin writeln('-',i); break; end;
end;
if n>0 then begin c:=n+b*1.2; writeln(c:0:0) end;
close(input);
close(output);
end.