abc096b = do
    [a,b,c] <- readArray getLine
    n <- readLn::IO Int
    let mx = maximum [a,b,c]
    print $ sum[a,b,c] + mx * (pow2 n -1)
        where pow2 0 = 1
              pow2 x = pow2 (x-1) * 2

main = abc096b

readArray::IO String -> IO[Int]
readArray = fmap $ map read . words