class PriorityQueue

  def initialize(heap=[])
    @size = heap.size
    @heap = heap.sort
  end

  # log( log n )
  def push x
    i = @size
    @size += 1
    while i > 0
      par = ( i - 1 ) / 2
      break if @heap[par] <= x
      @heap[i] = @heap[par]
      i = par
    end
    @heap[i] = x
  end

  # log( log n )
  # return nil if @size == 0
  def pop

    ret = @heap[0]
    x = @heap[@size-=1]
    # @heap.delete_at(-1)

    i = 0
    while (child = i * 2 + 1) < @size
      child_1 = i * 2 + 2
      child = child_1 if child_1 < @size && @heap[child_1] < @heap[child]
      break if @heap[child] >= x
      @heap[i] = @heap[child]
      i = child
    end

    @heap[i] = x
    @heap.delete_at(-1)
    ret
  end

  def size
    @heap.size
  end

  def top
    @heap[0]
  end

  def any?
    @size > 0
  end

  def empty?
    @size == 0
  end

  def all
    @heap
  end

  def first
    @heap[0]
  end

  def second
    @size < 3 ? @heap[1] : [@heap[1], @heap[2]].min
  end

  def third
    @size < 3 ? nil : [@heap[1], @heap[2]].max
  end
  
  def sum
    @heap.reduce(0){|s,t| s+t }
  end
  
  def update
    if second && (-top) / 2 < -second
      push( -( -pop / 2 ))
    else
      @heap[0] = -( -@heap[0] / 2 )
    end
  end
end

class Nil
end

class Array

  include Comparable

  def to_pq
    PriorityQueue.new(self)
  end
  
  def -@
    map{|e| -e.to_i }
  end
end

n, m = gets.to_s.split.map{|t|  t.to_i }
a    = gets.to_s.split.map{|t| -t.to_i }
# 大きい順に見たいが、PriorityQueueが小さいのが優先なので、マイナスをつけていく。

q = PriorityQueue.new(a)

m.times do
  q.update
end
# p q.all
puts -q.sum