{-# LANGUAGE BangPatterns #-}
import Control.Applicative((<$>))
import Control.Monad
import Data.Map ((!))
import qualified Data.Map as M
import qualified Data.List as L
import Data.Maybe (catMaybes)
-- import qualified Data.Char as C
-- import qualified Data.IntSet as I
import Debug.Trace
--------------------------------------------
readInt    = read :: String -> Int
getInt     = readInt <$> getLine
getIntList = map readInt . words <$> getLine
int2bin 0 =  []
int2bin n =  n `mod` 2 : int2bin (n `div` 2)
----------------------------------------------

-- dp[n] = min(a[0.25]+dp[n-0.25], a[0.5]+dp[n-0.5], a[1]+dp[n-1], a[2]+dp[n-2])

main :: IO ()
main = do
  [q,h,s,d] <- map read . words <$> getLine
  n <- read <$> getLine
  let pay = M.fromList [(0.25,q),(0.5,h),(1.0,s),(2.0,d)] :: M.Map Float Integer
  print $ solve 0.5 n pay (M.fromList [(0,0),(0.25,q)])

solve :: Float -> Float -> M.Map Float Integer -> M.Map Float Integer -> Integer
solve cur n pay dp
  | cur == n+0.25  = dp!n
  | otherwise =
    let a = Just $ pay!0.25 + dp!(cur-0.25)
        b = Just $ pay!0.5  + dp!(cur-0.5)
        c = if cur >= 1 then Just ((pay!1) + (dp!(cur-1))) else Nothing
        d = if cur >= 2 then Just ((pay!2) + (dp!(cur-2))) else Nothing
    in solve (cur+0.25) n pay $ M.insert cur (minimum (catMaybes [a,b,c,d])) dp
