class Heap
  attr_reader :arr

  def initialize(arr = [])
    @arr = []
    arr.each {|val| push(val) }
  end

  def condition(parent, child)
    parent >= child
  end

  def push(val)
    idx = @arr.size
    while idx > 0
      parent_idx = (idx - 1) / 2
      break if condition(@arr[parent_idx], val)
      @arr[idx] = @arr[parent_idx]; idx = parent_idx
    end
    @arr[idx] = val
  end

  def top
    @arr[0]
  end

  def pop
    ret = @arr[0]
    val = @arr.pop
    return ret if @arr.empty?
    idx = 0
    while true
      left = idx * 2 + 1; l_val = @arr[left]
      right = idx * 2 + 2; r_val = @arr[right]
      if right < @arr.size && !condition(val, r_val) && !condition(l_val, r_val)
        @arr[idx] = r_val; idx = right
      elsif left < @arr.size && !condition(val, l_val)
        @arr[idx] = l_val; idx = left
      else
        break
      end
    end
    @arr[idx] = val
    return ret
  end
end

_, M = gets.split.map(&:to_i)
h = Heap.new gets.split.map(&:to_i)
M.times do
  h.push(h.pop / 2)
end
puts h.arr.inject(&:+)
