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 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 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 i=0 0 i a+=t t a p+=[(j,t)] [(j,t)] p j=s.pop() s.pop() j s=[] [] s p=[] [] p t=i-j i-j t a=i=0 0 a i+=1 1 i
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)
