import scala.io.{StdIn => in}

object Main extends App {
  val abc = in.readLine.split(" ").map(_.toInt)
  val k =  in.readInt - 1

  val m = abc.max
  val ans = m * (2 << k) + abc.sum - m
  println(ans)
}