local floor = math.floor
-- heap
local function Heap(upper_func)
    local floor = math.floor
    local a = {}
    local upper = function(k1, k2)
        --assert(k1 < k2)
        if k1 == 0 then
            return false
        else
            return upper_func(a[k1], a[k2])
        end
    end

    local lower = function(k1, k2)
        return not upper(k1, k2)
    end

    local function count()
        return #a
    end

    local function _swap(k1, k2)
        local old_k1 = a[k1]
        a[k1] = a[k2]
        a[k2] = old_k1
    end

    local function upheap(newk)
        local ku = floor(newk / 2)
        local k = newk
        while ku > 0 and lower(ku, k) do
            _swap(ku, k)
            k = floor(k/2)
            ku = floor(ku/2)
        end
    end
    
    local insert = table.insert
    local function insertq(e)
        insert(a, e)
        upheap(#a)
    end
    
    local function downheap(newk)
        local k = newk
        while k <= floor(#a/2) do
            local kdl = k*2
            local kdr = kdl + 1
            local kd
            if kdr <= #a and lower(kdl, kdr) then
                kd = kdr
            else
                kd = kdl
            end
            if upper(k, kd) then
                break
            end
            _swap(k, kd)
            k = kd
        end
    end
    
    local function top()
        --assert(#a >= 1)
        return a[1]
    end
    
    local remove = table.remove
    local function remove_top()
        --assert(#a >= 1)
        local v = a[1]
        _swap(1, #a)
        remove(a)
        downheap(1)
        return v
    end

    local self = {}
    self.count = count
    self.insertq = insertq
    self.top = top
    self.remove_top = remove_top
    return self
end

---
local N, M = io.read("*n", "*n")
local q = Heap(function (x,y) return x > y end)
local insertq = q.insertq
local remove_top = q.remove_top
for i=1,N do
    insertq(io.read("*n"))
end
for i=1,M do
    local top = remove_top()
    top = top / 2
    insertq(top)
end
local sum = 0
for i=1,N do
    local top = remove_top()
    sum = sum + floor(top)
end
print(sum)