import Data.List
import Data.Ord
import Data.Char
import Data.Ratio
import Data.Maybe

main = do
  [a,b,c] <- sort .map (read::String->Int) . words <$> getLine
  n <- readLn :: IO Int
  print $ a+b+c*2^n