input = gets.to_s.split(" ").map(&:to_i)
value_A = gets.to_s.split(" ").map(&:to_i)

sina_kosu = input[0]
waribiki = input[1]

new_value = 0
index = 0
sum = 0
value_A.sort!.reverse!  
priority_queue = []
priority_queue << value_A.shift / 2

for i in 0..waribiki-2 do
  if value_A == []
    value_A = priority_queue
    priority_queue = []
    priority_queue << value_A.shift / 2

  elsif value_A[0] > priority_queue[0]
    priority_queue << value_A.shift / 2
  else
    priority_queue << priority_queue.shift / 2
  end
end

value_A.each do |a|
  sum += a
end

priority_queue.each do |a|
  sum += a
end

puts sum
