import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = println(solve(new Scanner(System.in)))

  def solve(in: String): String = solve(new Scanner(in))

  def solve(sc: Scanner): String = {
    val ABC = Array.fill(3)(sc.nextInt)
    val K = sc.nextInt

    var (n, i) = ABC.zipWithIndex.maxBy(_._1)
    val rest = ABC.zipWithIndex.filter(_._2 != i).map(_._1).sum
    for (i <- 1 to K) {
      n *= 2
    }
    (rest + n).toString
  }
}
