fun main(args: Array<String>) {
    val nums = readInputLine().split(" ").map { it.toInt() }.sortedDescending()
    val K = readInputLine().toInt()
    
    println(nums[0] * pow2(K) + nums[1] + nums[2])
}

fun readInputLine(): String {
    return readLine()!!
}

fun pow2(x: Int): Int {
    var tmp = 1
    for (i in 1..x) {
        tmp *= 2
    }
    return tmp
}
