import Foundation

let line = readLine()!
let numbers = line.components(separatedBy: " ")

var first = Int(numbers[0])!
var second = Int(numbers[1])!
var third = Int(numbers[2])!

let count = Int(readLine()!)!

for _ in 0..<count {
    if first >= second && first >= third {
        first = first * 2
    } else if second >= first && second >= third {
        second = second * 2
    } else if third >= first && third >= second {
        third = third * 2
    }
}

print("\(first + second + third)")