class PriorityQueue
  def initialize()
    @hash = Hash.new{|h,k| h[k] = [] }
  end
  def push(val, priority)
    @hash[priority].push val
  end
  def maxmum
    @hash.max_by(&:first)
  end
  def pop
    key,que = maxmum
    val = que.pop
    @hash.delete(key) if que.empty?
    val
  end
  def empty?
    @hash.empty?
  end
end

N,M = gets.split.map(&:to_i)
prices = gets.split.map(&:to_i).sort_by{|v| -v}
pq = PriorityQueue.new
prices.each{|v| pq.push(v,v) }
M.times do
  price = pq.pop / 2
  pq.push(price, price)
end

puts Array.new(N){ pq.pop }.sum