import Control.Applicative( (<$>))

main = do
    [q_, h_, s_, d_] <- map read . words <$> getLine
    n_	<- readLn::IO Integer
    let
	min'::Integer->Integer
	min' 0 = 0
	min' 1 = q_
	min' 2 = min (2*min' 1) h_
	min' 3 = minimum [  min' 2 + min' 1 ]
	min' 4 = minimum [  min' 3 + min' 1 ,
			    2*min' 2	    ,
			    s_		    ]
	min' 5 = minimum [  min' 4 + min' 1	, 
			    min' 3 + min' 2	]
	min' 6 = minimum [  min' 5 + min' 1	    ,
			    min' 4 + min' 2	    ,
			    2*min' 3		    ]
	min' 7 = minimum [  min' 6 + min' 1,
			    min' 5 + min' 2,
			    min' 4 + min' 3]
	min' 8 = minimum [  d_,
			    min' 7 + min' 1 ,
			    min' 6 + min' 2 ,
			    min' 5 + min' 3 ,
			    2*min' 4	    ]
	units = 4*n_
	(d,m) = units `quotRem` 8
    print $ d*(min' 8) + min' m
