import Data.List

main = do
  abc <- map read . words <$> getLine :: IO [Int]
  k <- read <$> getLine :: IO Int
  print $  solve abc k

solve abc k =
  ans
  where
    m = maximum abc
    rest = delete m abc
    m' = m*(2^k)
    ans = sum rest + m'
    
  
