local function meld(a,b)
    if not a then
        return b
    elseif not b then
        return a
    elseif a[1]<b[1] then
        b[4]=a[3]
        a[3]=b
        return a
    else
        a[4]=b[3]
        b[3]=a
        return b
    end
end

local function pair(a,d)
    local b=a and a[4]
    if b then
        local c=b[4]
        a=meld(a,b)
        a[4]=d
        d=a
        return pair(c,d)
    else
        local e
        while d do
            e=d
            d=d[4]
            a=meld(a,e)
        end
        return a
    end
end

local PairingHeap={}

PairingHeap.empty=function(self)
    return not self[1]
end

PairingHeap.push=function(self,key,value)
    self[1]=meld(self[1],{key,value,false,false})
end

PairingHeap.top=function(self)
    return self[1][2]
end

PairingHeap.pop=function(self)
    self[1]=pair(self[1][3],false)
end

PairingHeap.join=function(self,other)
    self[1]=meld(self[1],other[1])
    return self
end

PairingHeap.new=function(self)
    local obj={false}
    setmetatable(obj,{__index=PairingHeap})
    return obj
end

----------

local n,m=io.read("n","n")
local a=PairingHeap:new()
for i=1,n do
    local input=io.read("n")
    a:push(-input,input)
end
 
for i=1,m do
    local x=a:top()
    x=math.floor(x/2)
    a:pop()
    a:push(-x,x)
end
 
local total=0
for i=1,n do
    total=total+a:top()
    a:pop()
end
print(string.format("%d",total))