fun main(args: Array<String>) {

    readInts().sortedDescending().let {
        println(it[0] * Math.pow(2.toDouble(), readInt().toDouble()).toInt() + it[1] + it[2])
    }
}

fun readInt(): Int = readLine()!!.toInt()
fun readInts(): List<Int> = readLine()!!.split(" ").map { it.toInt() }