#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

class PriorityQueue
    attr_accessor:heap,:n
    def initialize(n)
        @n=0
        @heap=array(n,INF)
    end

    def push(x)
        i=@n
        @n+=1
        while i>0
            p=(i-1)/2
            break if @heap[p]>=x
            @heap[i]=@heap[p]
            i=p
        end
        @heap[i]=x
    end

    def pop()
        i=0
        ret=@heap[0]
        @n-=1
        x=@heap[@n]
        while i*2+1<@n
            l=i*2+1
            r=i*2+2
            l=r if r<@n and @heap[l]<@heap[r]
            break if @heap[l]<=x
            @heap[i]=@heap[l]
            i=l
        end
        @heap[i]=x
        return ret
    end

    def empty?()
        return @n.zero?
    end
end
N,M=get_i
A=get_i
pq=PriorityQueue.new(N)
A.each do|a|
    pq.push(a)
end
M.times do|i|
    v=pq.pop/2
    pq.push(v)
end
ans=0
until pq.empty?
  ans+=pq.pop
end
puts ans