n,m = gets.chomp.split.map(&:to_i)
a = gets.chomp.split.map(&:to_i)

def apply_ticket(prices)
  prices.sort!.reverse!
  return prices if prices[0] == 0 

  prices[0] = (prices[0] / 2).floor
  return prices
end

def calc(num, ticket_num, prices)
  while ticket_num > 0
     prices = apply_ticket(prices)
     ticket_num -= 1
  end
  return prices.inject(:+)
end

puts calc(n, m, a)