module Main where

import Control.Applicative
import Control.Monad
import Data.List

main :: IO ()
main = do
    as <- fmap read . words <$> getLine
    k <- readLn
    let (x:xs) = sortBy (flip compare) as
    let ans = x * (2 ^ k) + sum xs
    print ans