n, m = gets.chomp.split(" ").map(&:to_i);
as = gets.chomp.split(" ").map(&:to_i);

as.sort!.reverse!

pp as
m.times do
  head = as.shift
  break if (head == 0)
  head /= 2
  index = 0
  as.each_with_index do |a, i|
    if head > a
      index=i
      break
    end
  end
  if index == 0
     as = [head].concat(as)
  else
     as = as[0..(index-1)].concat([head].concat(as[(index)..-1]))
  end
end

sum = 0
as.each do |a|
        sum += a
end

puts sum