import Control.Monad
import Data.List
insertionsort :: (Ord a) => [a] -> [a]
insertionsort = foldr insert []

inner 0 xs     = sum xs
inner m (x:xs) = inner (m-1) $ sortBy (\x y->compare y x) ((div x 2):xs)
 
main = do
 [n,m] <- map read . words <$> getLine :: IO [Int]
 a <- sortBy (\x y-> compare y x) . map read . words <$> getLine :: IO [Int]
 print $ inner m a