object Main extends App {
  import scala.io.StdIn.readLine
  val Array(a, b, c) = readLine().split(' ').map(_.toInt)
  val Array(k) = readLine().split(' ').map(_.toInt)

  val values = (0 until k).foldLeft(Array(a,b,c)) { case (values, _ ) =>
    val (maximum, maximumIdx) = values.zipWithIndex.maxBy(_._1)
    values.update(maximumIdx, maximum * 2)
    values
  }

  println(values.sum)
}
