@heap = []
def heappop
  t = @heap.shift
  tdn(0)
  return t
end
def tdn(x)
  n = @heap.size
  l = (x + 1) * 2 - 1
  r = l + 1
  if l < n && @heap[l] > @heap[x]
    @heap[l], @heap[x] = @heap[x], @heap[l]
    tdn(l)
  elsif r < n && @heap[r] > @heap[x]
    @heap[r], @heap[x] = @heap[x], @heap[r]
    tdn(r)
  end
end
def heapin(x)
  n = @heap.size
  @heap[n] = x
  bup(n)
end
def bup(x)
  return if x == 0
  pid = (x + 1) / 2 - 1
  if @heap[x] > @heap[pid]
    @heap[x], @heap[pid] = @heap[pid], @heap[x]
    bup(pid)
  end
end

n, m = gets.split.map(&:to_i)
a = gets.split.map(&:to_i)
a.each do |x|
  heapin(x)
end
m.times do
  b = heappop
  b /= 2
  heapin(b)
end
puts @heap.inject(:+)