input = gets.chomp.split(" ").map(&:to_i)
prices = gets.chomp.split(" ").map(&:to_i).sort.reverse
result = []
result << (prices.shift / 2)
 
(input[1]-1).times do 
  if prices.empty? || prices.first <= result.first
    result << (result.shift / 2)
  else
    result << (prices.shift / 2)
  end
end
sum = 0
prices.each do |e|
  sum += e
end
result.each do |e|
  sum += e
end
puts sum