ocal 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=(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(total)