n, m = gets.split.map(&:to_i)
a = gets.split.map(&:to_i)

a.sort!.reverse!

m.times do
  price = a[0]
  discount_price = price / 2
  a.shift
  new_index = a.bsearch_index { |x| x < discount_price }
  a.insert(new_index || -1, discount_price)
end

puts a.inject(:+)
