attrs = Array.new
while line = $stdin.gets
    attrs << line.chomp.split.map{|v| v.to_i }
end

tmp =  attrs.shift
N = tmp.shift
M = tmp.shift
A = attrs.shift.sort {|x,y| y<=>x}

M.times do
    break if A[0] == 0
    if N == 2
        A[0] = A[0] / 2
        next
    end
    for i in 0..(N - 2) do
        if A[i] >= A[i + 1] then
            A[i] = A[i] / 2
            A.sort! {|x,y| y<=>x}
            break
        end
    end
end


if N == 1 then
    M.times do A[0] = A[0] / 2 end
    puts A[0]
else
    puts A.inject(:+)
end