import Foundation
func toTuple<T>(_ args: [T]) -> (T, T, T) { (args[0], args[1], args[2]) }
func readInts() -> [Int] { readLine()!.split(separator: " ").map { Int($0)! } }

let (a, b, c) = toTuple(readInts())
let k = Int(readLine()!)!
let m = max(max(a, b), c)
print(m * Int(pow(2.0, Double(k))) + a + b + c - m)