N, M = gets.split(" ").map(&:to_i)
A = gets.split(" ").map(&:to_i).sort_by{|a| -a}
B = []
m = M
while m > 0 do
    if B.empty? || A[0] > B[0]
        a = A.shift
        B << (a / 2)
    else
        b = B.shift
        B << (b / 2)
    end
    m -= 1
    if A.empty?
        A = B
        B = []
    end
end

puts (A + B).inject(:+)
