n, m  = gets.chomp.split(" ").map(&:to_i)
a  = gets.chomp.split(" ").map(&:to_i).sort.reverse
afterDivide = [ a[0]/2 ]
a.shift
(m-1).times do
  if !a.empty?
    if afterDivide[0] < a[0]
      afterDivide.push(a[0]/2)
      a.shift
    else
      afterDivide.push(afterDivide[0]/2)
      afterDivide.shift
    end
  else
    afterDivide.push(afterDivide[0]/2)
    afterDivide.shift
  end
end
ans = 0
a.each do |x|
  ans += x
end
afterDivide.each do |x|
  ans += x
end
puts ans