section = gets.chomp.split( "" )
area = 0
depthArr = []
areaArr = []
depth = 0
section.each_with_index { |ground, i|
	if "\\" == ground
		depth += 1
		depthArr.push( i )
	elsif 0 < depth && "/" == ground
		if !depthArr.empty?
			j = depthArr.pop
			pool =  i - j
			area += pool
			
			while !areaArr.empty?
				preJ, prePool = areaArr.last
				if j <= preJ
					pool += prePool
					preJ, prePool = areaArr.pop
				else
					break
				end
			end
			areaArr.push( [ j, pool ] )
		end
	end
}
puts( area )
output = []
output.push( areaArr.length )
areaArr.each{ |arr|
	output.push( arr[1] )
}
puts( output.join( " " ) )