N, M = gets.split.map(&:to_i)
A = gets.split.map(&:to_i).sort

a = [0] + A
b = [a.pop]

M.times do |i|
  if a.last > (b.last * 2)
    a[-1] /= 2
  elsif a.last > b.last
    b.unshift(a.pop / 2)
  else
    b[-1] /= 2
  end
end

puts (a + b).inject(:+)
