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