import java.util.*

fun main(args: Array<String>) {
    // Your code here!
    val sc = Scanner(System.`in`)
    val a = sc.nextInt()
    val b = sc.nextInt()
    val c = sc.nextInt()
    val k = sc.nextInt()
    val l = listOf(a,b,c)
    println((l.sum() - l.max()!! + l.max()!! * Math.pow(2.0,k.toDouble())).toInt())
}