import Foundation
 
let abc = readLine()!.componentsSeparatedByString(" ")
let k = Int(readLine()!)!
let a = Int(abc[0])!
let b = Int(abc[1])!
let c = Int(abc[2])!
 
var m = max(a, b, c)
var m2: Int = m
for i in 0..<k {
    m2 *= 2
}
 
var m3: Int = 0
if m == a {
    m3 = m2 + b + c
} else if m == b {
    m3 = m2 + a + c
} else if m == c {
    m3 = m2 + a + b
}
 
print("\(m3)")