import Data.List

solve :: Int -> Int -> Int
solve n k
  | k == 0 = n
  | otherwise = solve (n * 2) (k - 1)

main = do
  ss <- (map read . words) <$> getLine
  k <- readLn :: IO(Int)
  print $ (solve (maximum ss) k) + (sum (take 2 (sort ss)))