n, m = STDIN.gets.split(/\s+/).map(&:to_i)
prices = STDIN.gets.split(/\s+/).map(&:to_i)
log2_prices = prices.map{|x| {price: x, log2_price: Math::log(x,2), ticket_count: 0} }
log2_prices.sort_by!{|x| -x[:log2_price] }
m.times do
   max_price = log2_prices[0]
   log2_prices[0] = {price: max_price[:price] / 2, log2_price: max_price[:log2_price] - 1, ticket_count:  max_price[:ticket_count] + 1 }
   log2_prices.sort_by!{|x| -x[:log2_price]}
end

sum_new_price = log2_prices.map{ |x| x[:price] }.inject(&:+)
puts sum_new_price