module Main where

import Control.Monad
import Control.Applicative

main = do
 [a, b, c] <- map (read::String -> Int) . words <$> getLine
 k <- fmap (read::String -> Int) getLine
 print $ solve a b c k

solve::Int -> Int -> Int -> Int -> Int
solve a b c k
 | a >= b && a >= c = a * (2 ^ k) + b + c
 | b >= a && b >= c = a + b * (2 ^ k) + c
 | c >= a && c >= b = a + b + c * (2 ^ k)

