fun main(args : Array<String>){
    val (Q, H, S, D) = readLine()!!.split(" ").map{ it.toLong() }
    val N = readLine()!!.toLong()

    class BottleList(val q : Long, val h : Long, val s : Long, val d : Long) : Comparable<BottleList>{

        val price : Long = q * Q + h * H + s * S + d * D 
        override fun compareTo(other : BottleList) : Int {
            return price.compareTo(other.price)
        } 
    }

    val patOne = BottleList(4, 0, 0, 0)
    val patTwo = BottleList(2, 1, 0, 0)
    val patThree = BottleList(0, 2, 0, 0)
    val patFour = BottleList(0, 0, 1, 0)
    val patFive = BottleList(0, 0, 0, 1)

    val minOneL = arrayOf(patOne, patTwo, patThree, patFour).min()!!.price
    val minTwoL = arrayOf(minOneL * 2, patFive.price).min()!!
    println(N / 2 * minTwoL + N % 2 * minOneL)
}