s = []
p = []
a = i = 0
for c in input():
	if c == "\\":
		s += [i]
	elif c == "/" and s:
		j = s.pop()
		t = i-j
		a += t
		while p and p[-1][0] > j:
			t += p[-1][1]
			p.pop()
		p += [(j,t)]
	i += 1

print(a)
if p:
	print(len(p),*list(zip(*p))[1])
else:
	print(0)
 s = [] s [] p = [] p [] a = i = 0 a 0 = i = 0 i 0 for c in input():
	if c == "\\":
		s += [i]
	elif c == "/" and s:
		j = s.pop()
		t = i-j
		a += t
		while p and p[-1][0] > j:
			t += p[-1][1]
			p.pop()
		p += [(j,t)]
	i += 1 c input() input if c == "\\":
		s += [i]
	elif c == "/" and s:
		j = s.pop()
		t = i-j
		a += t
		while p and p[-1][0] > j:
			t += p[-1][1]
			p.pop()
		p += [(j,t)]
	 c == "\\" c "\\" s += [i] s [i] i elif c == "/" and s:
		j = s.pop()
		t = i-j
		a += t
		while p and p[-1][0] > j:
			t += p[-1][1]
			p.pop()
		p += [(j,t)]
	 c == "/" and s c == "/" c "/" s j = s.pop() j s.pop() s.pop s pop t = i-j t i-j i j a += t a t while p and p[-1][0] > j:
			t += p[-1][1]
			p.pop()
		 p and p[-1][0] > j p p[-1][0] > j p[-1][0] [-1] p -1 0 j t += p[-1][1] t p[-1][1] [-1] p -1 1 p.pop() p.pop p pop p += [(j,t)] p [(j,t)] (j,t) j t i += 1 i 1 print(a) print a if p:
	print(len(p),*list(zip(*p))[1])
else:
	print(0) p print(len(p),*list(zip(*p))[1]) print len(p) len p *list(zip(*p))[1] list(zip(*p))[1] (zip(*p)) list zip(*p) zip *p p 1 print(0) print 0 p = [] [] p a = i = 0 0 a i = 0 0 i t += p[-1][1] p[-1][1] t j = s.pop() s.pop() j a += t t a i += 1 1 i t = i-j i-j t s = [] [] s p += [(j,t)] [(j,t)] p s += [i] [i] s
s = []
p = []
a = i = 0
for c in input():
	if c == "\\":
		s += [i]
	elif c == "/" and s:
		j = s.pop()
		t = i-j
		a += t
		while p and p[-1][0] > j:
			t += p[-1][1]
			p.pop()
		p += [(j,t)]
	i += 1

print(a)
if p:
	print(len(p),*list(zip(*p))[1])
else:
	print(0)

