n = gets.chomp
l = Array.new
stk = Array.new
ls = Array.new

k = 0
n.length.times { |i|
	if n[i] == "\\"
		stk.push(i)
		ls[k] = i
	elsif n[i] == "/"
		j = stk.pop
		if j != nil
			if l[k] == nil
				l[k] = 0
			end
			l[k]+=1
			l[k]+=i-j-1
			while k != 0 && ls[k-1] > j
				l[k-1]+=l[k]
				l.pop
				k-=1
			end
			ls[k] = j
			k+=1
		end
	end
}

a = 0
k.times { |i|
	a += l[i]
}

puts a
print(k," ",l.join(" "),"\n")