
input = gets.chomp.split(" ").map(&:to_i)
prices = gets.chomp.split(" ").map(&:to_i).sort.reverse
i = 0
now_place = 0
final = input.min - 1
while i < input[1] do
  if now_place >= input[0]
    prices.sort.reverse
    now_place = 0
    if input[0] <= input[1]-i
	  final = input[0]-1
    else
      final = input[1]-i-1
    end
  end
  prices[now_place] = prices[now_place]/2
  if prices[now_place] <= prices[final]
    now_place += 1
  else
    final -= 1
  end
  i += 1
end
sum = 0
prices.each do |e|
  sum += e
end
puts sum
