output_description: Print the smallest number of yen you have to spend to buy exactly N liters of
  ice tea.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      Q H S D
      N
attempt: import sys
  
  
  ## io ##
  def IS():
      return sys.stdin.readline().rstrip()
  
  
  def II():
      return int(IS())
  
  
  def MII():
      return list(map(int, IS().split()))
  
  
  def MIIZ():
      return list(map(lambda x: x - 1, MII()))
  
  
  ## dp ##
  def DD2(d1, d2, init=0):
      return [[init] * d2 for _ in range(d1)]
  
  
  def DD3(d1, d2, d3, init=0):
      return [DD2(d2, d3, init) for _ in range(d1)]
  
  
  ## math ##
  def to_bin(x: int) -> str:
      return format(x, "b")  # rev => int(res, 2)
  
  
  def to_oct(x: int) -> str:
      return format(x, "o")  # rev => int(res, 8)
  
  
  def to_hex(x: int) -> str:
      return format(x, "x")  # rev => int(res, 16)
  
  
  MOD = 10**9 + 7
  
  
  def divc(x, y) -> int:
      return -(-x // y)
  
  
  def divf(x, y) -> int:
      return x // y
  
  
  def gcd(x, y):
      while y:
          x, y = y, x % y
      return x
  
  
  def lcm(x, y):
      return x * y // gcd(x, y)
  
  
  def enumerate_divs(n):
      """Return a tuple list of divisor of n"""
      return [(i, n // i) for i in range(1, int(n**0.5) + 1) if n % i == 0]
  
  
  def get_primes(MAX_NUM=10**3):
      """Return a list of prime numbers n or less"""
      is_prime = [True] * (MAX_NUM + 1)
      is_prime[0] = is_prime[1] = False
      for i in range(2, int(MAX_NUM**0.5) + 1):
          if not is_prime[i]:
              continue
          for j in range(i * 2, MAX_NUM + 1, i):
              is_prime[j] = False
      return [i for i in range(MAX_NUM + 1) if is_prime[i]]
  
  
  ## libs ##
  from itertools import accumulate as acc
  from collections import deque, Counter
  from heapq import heapify, heappop, heappush
  from bisect import bisect_left
  
  # ======================================================#
  
  
  def main():
      q, h, s, d = MII()
      n = II()
      print(int((n // 2) * min(8 * q, 4 * h, 2 * s, d) + (n % 2) * min(4 * q, 2 * h, s)))
  
  
  if __name__ == "__main__":
      main()
  
problem_description: Statement
  
  You've come to your favorite store Infinitesco to buy some ice tea.
  
  The store sells ice tea in bottles of different volumes at different costs.
  Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen,
  a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has
  an infinite supply of bottles of each type.
  
  You want to buy exactly N liters of ice tea. How many yen do you have to
  spend?
samples: [{"input": "20 30 70 90\n    3", "output": "150\n    \n\nBuy one 2-liter bottle and two 0.5-liter bottles. You'll get 3 liters for 90 +\n30 + 30 = 150 yen.\n\n* * *"}, {"input": "10000 1000 100 10\n    1", "output": "100\n    \n\nEven though a 2-liter bottle costs just 10 yen, you need only 1 liter. Thus,\nyou have to buy a 1-liter bottle for 100 yen.\n\n* * *"}, {"input": "10 100 1000 10000\n    1", "output": "40\n    \n\nNow it's better to buy four 0.25-liter bottles for 10 + 10 + 10 + 10 = 40 yen.\n\n* * *"}, {"input": "12345678 87654321 12345678 87654321\n    123456789", "output": "1524157763907942"}]