n, m = gets.split.map(&:to_i)
things = gets.split.map(&:to_i).sort.reverse
m.times do
  num = things.shift
  div = num / 2
  index = things.bsearch_index{ |i| i < div }
  index ||= -1
  things.insert(index, div)
end
puts things.inject(:+)
