_item_num, coupon_num = gets.chomp.split(' ').map(&:to_i)
item_price_list = gets.chomp.split(' ').map(&:to_i).sort!
 
coupon_num.times do |i|
  price = item_price_list.sort!.pop
  discount_price = (price.to_i / 2).floor
  item_price_list << discount_price
end
 
puts item_price_list.inject(:+)