class Q
	def initialize
		@h = [] # max-heap
	end

	def enq(v)
		@h.push(v)
		up_heap
	end

	def deq
		max, min = @h[0], @h.pop
		unless @h.empty?
			@h[0] = min
			dn_heap
		end
		return max
	end

	def all(&block)
		return @h.each(&block)
	end

private
	def up_heap
		i = @h.size-1
		loop {
			iP = (i-1)/2
			break unless 0 <= iP
			break unless @h[iP] < @h[i]
			@h[iP], @h[i] = @h[i], @h[iP]
			i = iP
		}
	end

	def dn_heap
		i = 0
		loop {
			iC1 = 2*i+1
			break unless iC1 < @h.size
			iC2 = iC1+1
			iC = @h.size <= iC2 ? iC1 : @h[iC1] < @h[iC2] ? iC2 : iC1
			break unless @h[i] < @h[iC]
			@h[i], @h[iC] = @h[iC], @h[i]
			i = iC
		}
	end
end

N, M = gets.split.map(&:to_i)
A = gets.split.map(&:to_i)

q = Q.new
A.each{|a|
	q.enq a
}
M.times{
	q.enq(q.deq/2)
}
p q.all.inject(&:+)
