class PriorityQueue
  def initialize(array=[])
    @heap = array.sort_by(&:first)
  end
  def push(val, pri = nil)
    @heap.push([pri || val, val])
    adjust_up
  end
  def pop
    swap(0, @heap.size-1)
    val = @heap.pop[1]
    adjust_down
    val
  end
  def sort
    Array.new(@heap.size){ pop }
  end
  def size
    @heap.size
  end
  def empty?
    size == 0
  end
  private
  def adjust_down
    index = 0
    size = @heap.size
    while has_child?(index)
      left = index * 2 + 1
      right = left + 1
      min = left
      min = right if right < size && @heap[left][0] > @heap[right][0]
      if @heap[index][0] > @heap[min][0]
        swap(index, min)
        index = min
      else
        break
      end
    end
  end
  def adjust_up
    index = @heap.size - 1
    while index > 0
      parent = parent_index(index)
      if @heap[index][0] < @heap[parent][0]
        swap(index, parent)
      else
        break
      end
      index = parent
    end
  end
  def has_child?(idx)
    idx*2+1 < size
  end
  def parent_index(index)
    ((1+index) / 2) -1
  end
  def swap(x,y)
    @heap[x],@heap[y] = @heap[y],@heap[x]
  end
end


N,M = gets.split.map(&:to_i)
prices = gets.split.map(&:to_i)
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