n, m = gets.split.map(&:to_i)
a_arr = gets.split.map(&:to_i)
a_arr = a_arr.sort.reverse
a_arr.unshift(0)
a_arr.push(0)

before_i = 1
while m != 0
  if a_arr[before_i - 1] > a_arr[before_i]
    before_i = before_i - 1
  elsif a_arr[before_i+1] >= a_arr[before_i]
    if a_arr[before_i + 1] == 0
      break
    end
    before_i = before_i + 1
  else
    a_arr[before_i] /= 2
    m -= 1
  end
end

puts a_arr.inject(0, :+)