import Foundation

main()

func main() {
    let abc = readLine()!.split(separator: " ").map { Double($0)! }
    let k = Double(readLine()!)!
    let sorted = abc.sorted()
    let ans = sorted.dropLast().reduce(sorted.last! * pow(2.0, k), +)
    print(Int(ans))
}
