require 'pp'

class Element
    attr_reader :data, :priority

    def initialize(data, priority)
        @data, @priority = data, priority
    end

    def <=>(other)
        @priority <=> other.priority
    end
end

class PriorityQueue
    attr_reader :entries
    def initialize
        @entries = []
    end

    def push(element)
        i = @entries.bsearch_index {|e| e.priority >= element.priority }
        if i
            @entries.insert(i, element)
        else
            @entries.push(element)
        end
    end

    def pop
        @entries.pop
    end

    def empty?
        @entries.empty?
    end
end
     
n, m = gets.chomp!.split(" ").map(&:to_i)
a_n = gets.chomp!.split(" ").map(&:to_i)
pq = PriorityQueue.new
a_n.each do |x|
    pq.push(Element.new(x, x))
end

sum = 0
while pq.empty?.!
   x = pq.pop
   #pp x
   if m > 0
       y = x.data / 2
       pq.push(Element.new(y, y))
       m -= 1
   else
        sum += x.data
   end
end

puts sum
