#input of int(split by space)
def get_i()
  return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
  return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
  return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
  return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
  return bool ? y : n 
end
#create of array
def array(size1,init=nil,size2=-1)
  if size2==-1
      return Array.new(size1){init}
  else
      return Array.new(size2){Array.new(size1){init}}
  end
end

def max(a,b)
    return a>b ? a : b
end

def min(a,b)
    return a>b ? b : a
end

INF=Float::INFINITY
#====PriorityQueue====

class PriorityQueue
    attr_accessor:heap,:size,:fanc
    def initialize(size,init,&fanc)
      @fanc=fanc
      @size=0
      @heap=Array.new(size){ init }
    end

    def push(x)
        i=@size
        @size+=1
        while i>0
            par=(i-1)/2
            break if @fanc.call(@heap[par],x)!=1
            @heap[i]=@heap[par]
            i=par
        end
        @heap[i]=x
    end

    def pop()
        min_v=@heap[0]
        i=0
        @size-=1
        x=@heap[@size]
        while i*2+1<@size
            left=i*2+1
            right=i*2+2
            left=right if right<@size and @fanc.call(@heap[left],@heap[right])==1
            break if @fanc.call(x,@heap[left])!=1
            @heap[i]=@heap[left]
            i=left
        end
        @heap[i]=x
        return min_v
    end

    def empty?
        return @size.zero?
    end
end
N,M=get_i
A=get_i
pq=PriorityQueue.new(N,-INF){|x,y| y<=>x}
A.each do|a|
    pq.push(a)
end
M.times do
    v=pq.pop/2
    pq.push(v) 
end
ans=0
until pq.empty?
    ans+=pq.pop 
end
puts ans