input = gets.to_s.split(" ").map(&:to_i)
value_A = gets.to_s.split(" ").map(&:to_i)

sina_kosu = input[0]
waribiki = input[1]

new_value = 0
index = 0
sum = 0

for i in 0..waribiki-1 do
  max = value_A.sort!.pop  
  new_value = max / 2
  value_A.push(new_value)
end

value_A.each { |i| sum += i }

puts sum