fun main(args:Array<String>):Unit{
    val abc = readLine()!!.split(' ').map(String::toInt)
    val k = readLine()!!.toInt()
    println(abc.sum() + abc.max()!! * exp(2, k) - abc.max()!!)
}
fun exp(base:Int, e:Int):Int{
    return when(e){
        0 -> 1
        1 -> base
        else -> exp(base, e / 2).let{it * it * exp(base, e % 2)}
    }
}