import scala.io.Source

object Main extends App {
  val lines: Iterator[String] = Source.stdin.getLines()
  val line = lines.next.split(" ").map(_.toInt)
  val a = line.head
  val b = line(1)
  val c = line(2)
  val k = lines.next.toInt

  val max = List(a, b, c).max
  val rest = if (a == max) List(b, c) else if (b == max) List(a, c) else List(a, b)
  println((max * Math.pow(2, k) + rest.sum).toInt)
}
