inputs = STDIN.gets.split('')

terrain = []
areas = []

inputs.each do |input_char|
  case input_char
  when '\\','_'
    terrain.push(input_char)
  when '/'
    work = terrain.dup
    current = work.pop
    depth   = 0
    width   = 0
    area    = 0
    until current.nil? or depth < 0
      if current == '\\'
        if depth == 0
          # ?????????????????????
          area += width + 1
          break
        elsif depth == 1
          # ????????£????°´??????????????±???
          area  += areas.pop.to_i
        end
        depth -= 1
        width += 1
      elsif current == '_'
        width += 1
      elsif current == '/'
        depth += 1
        width += 1
      end
      current = work.pop
    end
    areas.push(area)
    terrain.push(input_char)
  end
end

#total area
print "#{areas.inject { |sum,x| sum + x }}\n"
#num of area
print "#{areas.count} "
#areas
print "#{areas.join(' ')}"