import Control.Monad

power :: Int -> Int
power 0 = 1
power n = 2 * power (n - 1)

main = do
    [a, b, c] <- map (read::String->Int) . words <$> getLine
    k <- readLn
    let m = maximum [a, b, c]
    let s = sum [a, b, c]
    let k' = power k
    let ret = m * k' + s - m
    print ret

