program busses;
var
sz:array[1..10]of longint;
hx:array[0..1000000]of longint;
i,j,n:longint;
begin
assign(input,'busses.in');
assign(output,'busses.out');
reset(input);
rewrite(output);
for i:=1 to 10 do
read(sz[i]);
readln(n);
for i:=1 to n do
hx[i]:=2147483647;
hx[0]:=0;
for i:=0 to n do
for j:=1 to 10 do
if hx[i]+sz[j]<hx[i+j] then hx[i+j]:=hx[i]+sz[j];
writeln(hx[n]);
close(input);
close(output);
end.