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

N = int(eval(input()))

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

ans = (N//2)*a2

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

ans += (N%2)*a1

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

N = int(eval(input()))

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

cnt = (N//2)*x2

N = N%2

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

cnt += N*x1

print(cnt)
Q, H, S, D = list(map(int, input().split()))
N = int(eval(input()))
a2 = min(Q * 8, H * 4, S * 2, D)
ans = (N // 2) * a2
a1 = min(Q * 4, H * 2, S)
ans += (N % 2) * a1
print(ans)

Q, H, S, D = list(map(int, input().split()))
N = int(eval(input()))
x2 = min(D, 2 * S, 4 * H, 8 * Q)
cnt = (N // 2) * x2
N = N % 2
x1 = min(S, 2 * H, 4 * Q)
cnt += N * x1
print(cnt)

-a2 = min(Q * 8, H * 4, S * 2, D) -ans = (N // 2) * a2 -a1 = min(Q * 4, H * 2, S) -ans += (N % 2) * a1 -print(ans) +x2 = min(D, 2 * S, 4 * H, 8 * Q) +cnt = (N // 2) * x2 +N = N % 2 +x1 = min(S, 2 * H, 4 * Q) +cnt += N * x1 +print(cnt)