class Pair
	attr_accessor :first, :second
	def initialize(a, b)
		@first  = a
		@second = b
	end
end

s1 = []
s2 = []
sum = 0

input = STDIN.gets
input.each_char.with_index do |c, i|
	if c == "\\"
		s1.push i
	elsif c == "/" && s1.size > 0
		j = s1.pop
		sum += i - j
		a = i -j
		while s2.size > 0 && s2.last.first > j
			a += s2.pop.second
		end
		s2.push(Pair.new(j, a))
	end
end

ans = []
until s2.empty?
	ans << s2.pop.second
end
puts sum
print ans.size
ans.reverse_each do |n|
	printf " #{n}"
end
print "\n"