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