module Main where

import           Control.Monad
import           Data.List
import           Data.Ord
import           Data.List.Split
import           Data.Array.IO
import qualified Data.Vector.Unboxed as V

main :: IO ()
main = do
  (a:bc) <- sortOn Down . map read . words <$> getLine
  k <- readLn
  print $ (2 ** k * a) + sum bc
  where (**) a k | k < 2 = a
                 | otherwise = (**) (a * a) (k - 1)
