import scala.io.StdIn

object Main extends App {
  val source = StdIn.readLine.split(" ").map(_.toInt).sorted
  val k = StdIn.readLine.toInt
  source(source.size - 1) = source.last << k
  println(source.sum)
}