import scala.io.StdIn

object Main extends App {
  val Array(a, b, c) = StdIn.readLine().split(' ').map(_.toInt)
  val (max, other) = if(a >= b && a >= c) {
    (a, b + c)
  } else if(b >= a && b >= c) {
    (b, a + c)
  } else {
    (c, a + b)
  }
  val k = StdIn.readLine().toInt
  val r = (0 until k).foldLeft(max) { (acc, _) =>
    acc*2
  } + other
  
  println(r)
  
}
