n, m = gets.split(" ").map(&:to_i)
a = gets.split(" ").map(&:to_i)
sum = a.inject(:+)
v = []
a.each{|x|
	z=x
	while true do
	y = z/2
	t = z-y
	z = y
	if t>0
		v.push(t)
	else
		break
	end
	end
}
p sum - v.sort!.reverse!.take(m).inject(:+)
