class BinaryHeap
  def initialize(&block)
    @cmp = block || lambda{ |a,b| a <=> b }
    @array = [nil]
    @place = {}
  end

  def add(obj)
    @array << obj
    idx = size
    @place[obj].nil? ? @place[obj] = [idx] : @place[obj] << idx
    upheap(idx)
  end

  def size
    @array.length - 1
  end

  def peek
    @array[1]
  end

  def poll
    return if @array.length == 1
    res = @array[1]
    @array[1] = @array.pop
    @place[res].delete(1)
    @place[peek].delete(@array.length)
    @place[peek] << 1
    downheap(1)
    res
  end

  def remove(obj)
    idx = @place[obj]&.pop
    return if idx.nil?
    last = @array[idx] = @array.pop
    @place[last].delete(@array.length)
    @place[last] << idx
    downheap(idx)
    upheap(idx) if last == @array[idx]
  end

  def to_a
    @array[1..-1].dup
  end
  
  private

  def upheap(c_idx)
    p_idx = c_idx/2
    parent = @array[p_idx]
    child = @array[c_idx]
    return if parent.nil? || @cmp.call(child, parent) <= 0

    @array[p_idx] = child
    @array[c_idx] = parent
    @place[parent].delete(p_idx)
    @place[parent] << c_idx
    @place[child].delete(c_idx)
    @place[child] << p_idx
    upheap(p_idx)
  end

  def downheap(p_idx)
    cl_idx = p_idx * 2
    cr_idx = cl_idx + 1
    parent = @array[p_idx]
    child_l = @array[cl_idx]
    child_r = @array[cr_idx]
    return if child_l.nil?
    
    if child_r.nil? || @cmp.call(child_l, child_r) > 0
      child = child_l
      c_idx = cl_idx
    else
      child = child_r
      c_idx = cr_idx
    end
    if @cmp.call(child, parent) > 0
      @array[p_idx] = child
      @array[c_idx] = parent
      @place[parent].delete(p_idx)
      @place[parent] << c_idx
      @place[child].delete(c_idx)
      @place[child] << p_idx
      downheap(c_idx)
    end
  end
end

N,M = gets.split(' ').map(&:to_i)
A = gets.split(' ').map(&:to_i)
pq = BinaryHeap.new { |a,b| a <=> b }
A.each { |num| pq.add(num) }
M.times do
  num = pq.poll
  num /= 2
  pq.add(num)
end
puts pq.to_a.inject(:+)
