stack = []
pond = []
x = 0

str = gets.chomp
str.each_char{|c|
    case c
    when "\\"
        stack.push x
    when "/"
        if start = stack.pop
            pond[stack.length] = [] if pond[stack.length].nil?
            pond[stack.length] << x - start
            if pond[stack.length + 1]
                dum = 0
                dum += pond[stack.length + 1].pop until pond[stack.length + 1].empty?
                pond.delete_at stack.length + 1
                pond[stack.length][-1] += dum
            end
        end
    end
    x += 1
}

pond.flatten!.compact!
puts pond.inject(:+)
puts "#{pond.length} #{pond.join(" ")}"