data =input()
s1 =[]
ans =[]
memo=-1
for i in range(len(data)):
	if data[i]=='\\':
		s1.append(i)
	if data[i]=='/':
		if len(s1)==0:pass
		# elif len(s1)==1:
		# 	ans.append(i-s1.pop())
		else:
			a = i-s1[-1]
			while len(ans)!=0:
				if ans[-1][1]<=s1[-1]:break
				a+=ans.pop()[0]
			ans.append([a,s1.pop()])

	# print(ans)
ans2=[int(ans[i][0]) for i in range(len(ans))]
print(sum(ans2))
print(len(ans),end='')
if len(ans):
	print('',end=' ')
print(' '.join(list(map(str,ans2))))


 data =input() data input() input s1 =[] s1 [] ans =[] ans [] memo=-1 memo -1 for i in range(len(data)):
	if data[i]=='\\':
		s1.append(i)
	if data[i]=='/':
		if len(s1)==0:pass
		# elif len(s1)==1:
		# 	ans.append(i-s1.pop())
		else:
			a = i-s1[-1]
			while len(ans)!=0:
				if ans[-1][1]<=s1[-1]:break
				a+=ans.pop()[0]
			ans.append([a,s1.pop()])

	# print(ans) i range(len(data)) range len(data) len data if data[i]=='\\':
		s1.append(i)
	 data[i]=='\\' data[i] data i '\\' s1.append(i) s1.append s1 append i if data[i]=='/':
		if len(s1)==0:pass
		# elif len(s1)==1:
		# 	ans.append(i-s1.pop())
		else:
			a = i-s1[-1]
			while len(ans)!=0:
				if ans[-1][1]<=s1[-1]:break
				a+=ans.pop()[0]
			ans.append([a,s1.pop()])

	# print(ans) data[i]=='/' data[i] data i '/' if len(s1)==0:pass
		# elif len(s1)==1:
		# 	ans.append(i-s1.pop())
		else:
			a = i-s1[-1]
			while len(ans)!=0:
				if ans[-1][1]<=s1[-1]:break
				a+=ans.pop()[0]
			ans.append([a,s1.pop()])

	# print(ans) len(s1)==0 len(s1) len s1 0 a = i-s1[-1] a i-s1[-1] i s1[-1] s1 -1 while len(ans)!=0:
				if ans[-1][1]<=s1[-1]:break
				a+=ans.pop()[0]
			 len(ans)!=0 len(ans) len ans 0 if ans[-1][1]<=s1[-1]:break
				 ans[-1][1]<=s1[-1] ans[-1][1] [-1] ans -1 1 s1[-1] s1 -1 a+=ans.pop()[0] a ans.pop()[0] ans.pop() ans.pop ans pop 0 ans.append([a,s1.pop()]) ans.append ans append [a,s1.pop()] a s1.pop() s1.pop s1 pop int(ans[i][0]) for i in range(len(ans)) for i in range(len(ans)) i range(len(ans)) range len(ans) len ans for i in range(len(ans)) int(ans[i][0]) int ans[i][0] [i] ans i 0 ans2=[int(ans[i][0]) for i in range(len(ans))] ans2 [int(ans[i][0]) for i in range(len(ans))] print(sum(ans2)) print sum(ans2) sum ans2 print(len(ans),end='') print len(ans) len ans end='' end '' if len(ans):
	print('',end=' ') len(ans) len ans print('',end=' ') print '' end=' ' end ' ' print(' '.join(list(map(str,ans2)))) print ' '.join(list(map(str,ans2))) ' '.join ' ' join list(map(str,ans2)) list map(str,ans2) map str ans2 ans =[] [] ans memo=-1 -1 memo ans2=[int(ans[i][0]) for i in range(len(ans))] [int(ans[i][0]) for i in range(len(ans))] ans2 data =input() input() data a+=ans.pop()[0] ans.pop()[0] a s1 =[] [] s1 a = i-s1[-1] i-s1[-1] a
data =input()
s1 =[]
ans =[]
memo=-1
for i in range(len(data)):
	if data[i]=='\\':
		s1.append(i)
	if data[i]=='/':
		if len(s1)==0:pass
		# elif len(s1)==1:
		# 	ans.append(i-s1.pop())
		else:
			a = i-s1[-1]
			while len(ans)!=0:
				if ans[-1][1]<=s1[-1]:break
				a+=ans.pop()[0]
			ans.append([a,s1.pop()])

	# print(ans)
ans2=[int(ans[i][0]) for i in range(len(ans))]
print(sum(ans2))
print(len(ans),end='')
if len(ans):
	print('',end=' ')
print(' '.join(list(map(str,ans2))))



