s=j=0
a=[];b=[];d=[]
for i,x in enumerate(input()):
    if x=='\\':a+=[i]
    elif x=='/' and a:
        j=a.pop()
        c=i-j;s+=c
        while b and b[-1]>j:c+=d.pop();b.pop()
        b+=[j];d+=[c]
print(s)
print(len(b),*(d)) s=j=0 s 0 =j=0 j 0 a=[] a [] b=[] b [] d=[] d [] for i,x in enumerate(input()):
    if x=='\\':a+=[i]
    elif x=='/' and a:
        j=a.pop()
        c=i-j;s+=c
        while b and b[-1]>j:c+=d.pop();b.pop()
        b+=[j];d+=[c] i x enumerate(input()) enumerate input() input if x=='\\':a+=[i]
    elif x=='/' and a:
        j=a.pop()
        c=i-j;s+=c
        while b and b[-1]>j:c+=d.pop();b.pop()
        b+=[j];d+=[c] x=='\\' x '\\' elif x=='/' and a:
        j=a.pop()
        c=i-j;s+=c
        while b and b[-1]>j:c+=d.pop();b.pop()
        b+=[j];d+=[c] x=='/' and a x=='/' x '/' a j=a.pop() j a.pop() a.pop a pop c=i-j c i-j i j s+=c s c while b and b[-1]>j:c+=d.pop();b.pop()
         b and b[-1]>j b b[-1]>j b[-1] b -1 j b+=[j] b [j] j d+=[c] d [c] c print(s) print s print(len(b),*(d)) print len(b) len b *(d) d d=[] [] d j=0 0 j a=[] [] a s+=c c s d+=[c] [c] d j=a.pop() a.pop() j b+=[j] [j] b s=j=0 0 s c=i-j i-j c b=[] [] b
s=j=0
a=[];b=[];d=[]
for i,x in enumerate(input()):
    if x=='\\':a+=[i]
    elif x=='/' and a:
        j=a.pop()
        c=i-j;s+=c
        while b and b[-1]>j:c+=d.pop();b.pop()
        b+=[j];d+=[c]
print(s)
print(len(b),*(d))