import java.util.Scanner

val sc = Scanner(System.`in`)

fun main(args:Array<String>){
    val a = sc.nextInt()
    val b = sc.nextInt()
    val c = sc.nextInt()
    val K = sc.nextInt()
    var arr:IntArray = intArrayOf(a,b,c)
   arr.sort()
    for(i in 0 .. K-1){
     arr[2] *= 2
    }
    println(arr[0]+arr[1]+arr[2])
}