main = do
  [a,b,c] <- fmap (map read . words) getLine
  k <- readLn
  print (solve k a b c)


solve :: Int -> Int -> Int -> Int -> Int
solve k a b c =
  sum [m*2^k,a,b,c] - m
  where
    m = maximum[a,b,c]