{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
import qualified Data.ByteString.Char8 as BC
import           Data.Maybe            (fromJust)

main :: IO ()
main = do
  [a, b, c] <- map readInt . BC.words <$> BC.getLine
  k <- readInt <$> BC.getLine
  print $ solve a b c k

solve :: Int -> Int -> Int -> Int -> Int
solve a b c k = maximum [a, b, c] * (2^k - 1) + sum [a, b, c]

readInt :: BC.ByteString -> Int
readInt = fst . fromJust . BC.readInt
