INF = 9999999999
def prque_pop(a, n)
  a[0] = a[n-1]
  a[n-1] = -INF
  id = 0
  while 1
    if 2*id+2 < n
      cmpid1 = cmpid2 = 2*id+1
      cmpid2 = 2*id+2 if a[2*id+2] != -INF
      if a[id] <= a[cmpid1] && a[id] <= a[cmpid2]
        swp = cmpid1
        swp = cmpid2 if a[cmpid2] != -INF && a[cmpid1] < a[cmpid2]
        tmp = a[id]
        a[id] = a[swp]
        a[swp] = tmp
        id = swp
      else
        break
      end
    else
      break
    end
  end
  return a
end

def prque_push(a, n, v)
  a[n-1] = v
  id = n-1
  while 1
    cmpid = (id-1) / 2
    if id > 0 && a[id] > a[cmpid]
      tmp = a[id]
      a[id] = a[cmpid]
      a[cmpid] = tmp
      id = cmpid
    else
      break
    end
  end
  return a
end


n, m = gets.split.map(&:to_i)
a = gets.split.map(&:to_i)

a.sort!{|a, b| b <=> a}

for i in 1..m
  break if a[0] == 0
  disc = a[0] / 2
  a = prque_pop(a, n)
  a = prque_push(a, n, disc)
end

sum = 0
a.each{|v| sum += v}
puts sum