Q,H,S,D=list(map(int,input().split()))

N=int(eval(input()))

Min1=min(4*Q,2*H,S)

Min2=min(2*Min1,D)

Even=N//2

Odd=N%2

ans=Even*Min2+Odd*Min1

print(ans)
Q,H,S,D=list(map(int,input().split()))

N=int(eval(input()))

N2,N1=divmod(N,2)

tmp2=min(8*Q,4*H,2*S,D)

tmp1=min(4*Q,2*H,S)

ans2=N2*tmp2

ans1=N1*tmp1

ans=ans1+ans2

print(ans)

Q, H, S, D = list(map(int, input().split()))
N = int(eval(input()))
Min1 = min(4 * Q, 2 * H, S)
Min2 = min(2 * Min1, D)
Even = N // 2
Odd = N % 2
ans = Even * Min2 + Odd * Min1
print(ans)

Q, H, S, D = list(map(int, input().split()))
N = int(eval(input()))
N2, N1 = divmod(N, 2)
tmp2 = min(8 * Q, 4 * H, 2 * S, D)
tmp1 = min(4 * Q, 2 * H, S)
ans2 = N2 * tmp2
ans1 = N1 * tmp1
ans = ans1 + ans2
print(ans)

-Min1 = min(4 * Q, 2 * H, S) -Min2 = min(2 * Min1, D) -Even = N // 2 -Odd = N % 2 -ans = Even * Min2 + Odd * Min1 +N2, N1 = divmod(N, 2) +tmp2 = min(8 * Q, 4 * H, 2 * S, D) +tmp1 = min(4 * Q, 2 * H, S) +ans2 = N2 * tmp2 +ans1 = N1 * tmp1 +ans = ans1 + ans2