import Data.List

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

solve :: Int -> Int -> Int -> Int -> Int
solve a b c k = a + b + c * 2 ^ k