import java.util.*

val sc = Scanner(System.`in`)
val A = sc.nextInt()
val B = sc.nextInt()
val C = sc.nextInt()
val K = sc.nextInt()

fun main(args: Array<String>) {
    val arr = arrayOf(A, B, C)
    println(arr.max()!! * (pow(2, K) - 1) + arr.sum())
}

fun pow(x: Int, n: Int): Int {
    var result = 1
    repeat(n) {
        result *= x
    }
    return result
}
