fun main(args:Array<String>) {
	val abc = readLine()!!.split(" ").map{ it.toInt() }
	val k = readLine()!!.toInt()
	val m=abc.max()!!
	val ans = abc.sum()-m + m*Math.pow(2.toDouble(),k.toDouble()).toLong()
	println(ans)
}