n,m = gets.chomp.split(" ").map(&:to_i)
a_arr = gets.chomp.split(" ").map(&:to_i).sort_by{|a| -a}

while m > 0 do
  m -= 1
  max = a_arr.shift
  max_2 = max / 2
  index = a_arr.bsearch_index{|a| a <= max_2} || a_arr.length
  if m >= index
    a_arr.insert(index, max_2)
    (0..(index-1)).each do |i|
      a_arr[i] /= 2
    end
    a_arr = a_arr.sort_by{|a| -a}
    m -= index
  else
    a_arr.insert(index, max_2)
    (0..(m-1)).each do |i|
      a_arr[i] /= 2
    end
    m = 0
  end
end

puts a_arr.inject(&:+)


