local floor = math.floor
-- heap
local Heap = {}
function Heap.new(upper_func)
    local self = setmetatable({}, {__index = Heap})
    self.a = {}
    self.upper_func = upper_func
    self.upper = function(k1, k2)
        assert(k1 < k2)
        if k1 == 0 then
            return false
        else
            return upper_func(self.a[k1], self.a[k2])
        end
    end
    self.lower = function(k1, k2)
        return not self.upper(k1, k2)
    end
    return self
end
 
function Heap:count()
    return #self.a
end
 
function Heap:_swap(k1, k2)
    local old_k1 = self.a[k1]
    self.a[k1] = self.a[k2]
    self.a[k2] = old_k1
end

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

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

for i=1,N do
    local top = q:remove_top()
    sum = sum + floor(top)
end
print(sum)