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)
    local b,c,d,e
    while a do
        c=false
        b=a
        a=a[4]
        b[4]=false
        if a then
            c=a
            a=a[4]   
            c[4]=false
        end
        b=meld(b,c)
        b[4]=d
        d=b
    end
    while d do
        e=d
        d=d[4]
        a=meld(a,e)
    end
    return a
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])
end

PairingHeap.join=function(self,other)
    if self[1][1]<other[1][1]then
		other[1][4]=self[1][3]
        self[1][3]=other[1]
	else
		self[1][4]=other[1][3]
        other[1][3]=self[1]
        self[1]=other[1]
    end
    return self
end

PairingHeap.new=function(self)
    local obj={}
    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))