import qualified Data.ByteString.Char8 as BS
import Data.Maybe
import Data.List

main :: IO ()
main = do
    [n,m] <- map read . words <$> getLine :: IO [Int]
    a <- map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine
    print . sum . last . take (m+1) $ iterate f a
  where
    f a = let (x:xs) = reverse $ sort a in (x `div` 2):xs