fun main(args: Array<String>) {
    val (q, h, s, d) = readLine()!!.split(" ").map(String::toLong)
    val n = readLine()!!.toInt()

    val result = if (n % 2 == 0) {
        longArrayOf(n * (q * 4), n * (h * 2), n * s, n * d / 2).min()!!
    } else {
        val tn = n - 1
        longArrayOf(tn * (q * 4), tn * (h * 2), tn * s, tn * d / 2).min()!! + longArrayOf((q * 4), (h * 2), s).min()!!
    }
    println(result)
}


