program busses;
type
fxz=array[0..10000] of longint;
var
f1,f2:text;
bus,ans:fxz;
i,n:longint;
procedure sc1(i:longint);
var
j:longint;
begin
for j:=0 to (i div 2) do
begin
if bus[j]+bus[i-j]<ans[i] then ans[i]:=bus[j]+bus[i-j];
end;
end;
procedure sc2(i:longint);
var
j:longint;
begin
for j:=1 to (i div 2) do
begin
if ans[j]+ans[i-j]<ans[i] then ans[i]:=ans[j]+ans[i-j];
end;
end;
begin
assign(f1,'busses.in');
assign(f2,'busses.out');
reset(f1);rewrite(f2);
for i:=1 to 10 do
read(f1,bus[i]);
readln(f1);
bus[0]:=0;
readln(f1,n);
for i:=1 to n do ans[i]:=999999999;
{................................................}
for i:=1 to 10 do
sc1(i);
if n>10 then for i:=11 to n do sc2(i);
writeln(f2,ans[n]);
close(f1);close(f2);
end.