-- maximum-sum.hs --- Maximum Sum

-- author: Seong Yong-ju <sei40kr@gmail.com>

solve a b c k = (max a (max b c)) * 2 ^ k

main :: IO ()
main = do
  [a, b, c] <- map (read :: String -> Int) . words <$> getLine
  k <- (read :: String -> Int) <$> getLine
  print $ solve a b c k
