const memo = {}

const main = stdin => {
  const input = stdin.trim().split('\n')
  const [A, B, C] = input[0].split(' ').map(x => parseInt(x))
  const K = parseInt(input[1])

  const max = Math.max(A, B, C)
  console.log(max * Math.pow(2, K) + A + B + C - max)
}


// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))
