class PQueue

    def initialize(array=[])
        @heap=Array.new
        if !array.empty?
            array.each do |value|
                self.push(value)
            end
        end
    end

    def push(value)
        node=@heap.size
        @heap.push(value)
        parent=(node-1)>>1
        until parent<0
            break if @heap[parent]>=@heap[node]
            @heap[parent],@heap[node]=@heap[node],@heap[parent]
            node=parent
            parent=(parent-1)>>1
        end
    end

    def top
        return @heap.first
    end

    def pop
        res=@heap.first
        value=@heap.pop
        node=0
        @heap[node]=value
        maxChild=node<<1+1
        until @heap.size<=maxChild
            maxChild+=1 if(maxChild+1<@heap.size && @heap[maxChild]>@heap[maxChild+1])
            break if @heap[node]>=@heap[maxChild]
            @heap[node],@heap[maxChild]=@heap[maxChild]<=@heap[node]
            node=maxChild
            maxChild=maxChild<<1+1
        end
        return res
    end

    def to_a
        return @heap
    end
end

N,M=gets.split.map(&:to_i)
a=gets.split.map(&:to_i)
pq=PQueue.new(a)
M.times do
    e=pq.pop/2
    pq.push(e)
end
puts pq.to_a.inject(&:+)

