n, m = gets.chomp.split(' ').map(&:to_i)
a = gets.chomp.split(' ').map(&:to_i)
a.sort!.reverse!

priority_queue = []
priority_queue << a.shift / 2

(m-1).times do
  if a == []
    a = priority_queue
    priority_queue = []
    priority_queue << a.shift / 2
  elsif a[0] > priority_queue[0]
    priority_queue << a.shift / 2
  else
    priority_queue << priority_queue.shift / 2
  end
end

sum = a.inject(:+)
sum += priority_queue.inject(:+)
print sum