n, m  = gets.split.map(&:to_i)
costs = gets.split.map(&:to_i)

# dp = Array.new(Array.new(10**5), 10**5)

costs.sort!

current_min = -1
# p costs

m.times do
    # costs.sort!
    # costs[-1] /= 2
    next_min = [-n, current_min - 1].max
    if costs[current_min] < costs[next_min]
        current_min = next_min
    end
    idx = costs.index(costs[current_min..-1].max)
    costs[idx] /= 2
end

puts costs.inject(&:+)
