program busses;
var
sz:array[1..10]of longint;
r:array[0..100000]of longint;
l,i,j:longint;
begin
assign(input,'busses.in');
assign(output,'busses.out');
reset(input);
rewrite(output);
for i:=1 to 10 do
read(sz[i]);
readln;
readln(l);
for i:=1 to l do
r[i]:=2147483646;
r[0]:=0;
for i:=0 to l do
begin
for j:=1 to 10 do
if i+j>l then break else
if r[i]+sz[j]<r[i+j] then r[i+j]:=r[i]+sz[j];
end;
writeln(r[l]);
close(input);
close(output);
end.