import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val A = scanner.nextLong()
    val B = scanner.nextLong()
    val C = scanner.nextLong()
    val K = scanner.nextLong()
    val list = mutableListOf(A, B, C)
    val sortedList = list.sorted().toMutableList()
    //println(sortedList)//1,2,3
    sortedList[2] = Math.pow(2.0, K.toDouble()).toLong() * sortedList[2]
    println(sortedList.sum())
}