import Control.Applicative ((<$>), (<*>))

main :: IO ()
main = solve <$> (map read <$> words <$> getLine) <*> readLn >>= print

solve :: [Int] -> Int -> Int
solve xs k = let m = maximum xs
             in sum xs - m + m * 2 ^ k
