program ex(f1,f2);
type
zn=array [0..50000] of longint;
la=array [0..10] of longint;
var
a:zn; c,d:la; f1,f2:text;
i,j,k,m,n,l,s,p,min:longint;
begin
assign(f1,'busses.in'); reset(f1);
assign(f2,'busses.out'); rewrite(f2);
for i:=1 to 10 do read(f1,d[i]);
readln(f1);
readln(f1,n);
a[1]:=d[1];
if 2*a[1]>d[2] then a[2]:=d[2] else a[2]:=2*a[1];
for i:=3 to 10 do
begin
min:=d[i];
for j:=1 to (i div 2) do
if a[j]+a[i-j]<min then min:=a[j]+a[i-j];
a[i]:=min;
end;
if n>10 then
for i:=11 to n do
begin
min:=99999999;
for j:=1 to (i div 2) do
if a[j]+a[i-j]<min then min:=a[j]+a[i-j];
a[i]:=min;
end;
writeln(f2,a[n]);
close(f1);
close(f2);
end.