q,h,s,d = list(map(int,input().split()))

n = int(eval(input()))



L2 = [8*q,4*h,2*s,d]

L2.sort()

L1 = [4*q,2*h,s]

L1.sort()

L5 = [2*q,h]

L5.sort()

L25 = [q]



ans = 0

if n >= 2:

    ans += n//2*L2[0]

    n = n%2

    if n == 1:

        ans += L1[0]

elif n == 1:

    ans = L1[0]

elif n == 0:

    ans = 0

    

print(ans)
q,h,s,d = list(map(int,input().split()))

n = int(eval(input()))



d1 = min([8*q,4*h,2*s,d])

s1 = min([4*q,2*h,s])



ans = 0

if n >= 2:

    ans += n//2*d1

    n = n%2

    if n == 1:

        ans += s1

elif n == 1:

    ans = s1

    

print(ans)
q, h, s, d = list(map(int, input().split()))
n = int(eval(input()))
L2 = [8 * q, 4 * h, 2 * s, d]
L2.sort()
L1 = [4 * q, 2 * h, s]
L1.sort()
L5 = [2 * q, h]
L5.sort()
L25 = [q]
ans = 0
if n >= 2:
    ans += n // 2 * L2[0]
    n = n % 2
    if n == 1:
        ans += L1[0]
elif n == 1:
    ans = L1[0]
elif n == 0:
    ans = 0
print(ans)

q, h, s, d = list(map(int, input().split()))
n = int(eval(input()))
d1 = min([8 * q, 4 * h, 2 * s, d])
s1 = min([4 * q, 2 * h, s])
ans = 0
if n >= 2:
    ans += n // 2 * d1
    n = n % 2
    if n == 1:
        ans += s1
elif n == 1:
    ans = s1
print(ans)

-L2 = [8 * q, 4 * h, 2 * s, d] -L2.sort() -L1 = [4 * q, 2 * h, s] -L1.sort() -L5 = [2 * q, h] -L5.sort() -L25 = [q] +d1 = min([8 * q, 4 * h, 2 * s, d]) +s1 = min([4 * q, 2 * h, s]) -    ans += n // 2 * L2[0] +    ans += n // 2 * d1 -        ans += L1[0] +        ans += s1 -    ans = L1[0] -elif n == 0: -    ans = 0 +    ans = s1