s1 = []
s2 = []

str = gets
i = 0
sum = 0
str.chars do |c|
	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[:pos] > j
			st = s2.pop
			a += st[:area]
		end
		s2.push({:pos => j, :area => a})
	end
	i += 1
end

puts sum
printf("%d %s", s2.size, s2.map{|h|h[:area]}.join(" ").chomp)