s=input()
stack=[]
tmpans=[]
ans=[]
for k,v in enumerate(s):
    if v=="\\":
        stack.append(k)
    elif v=="/" and len(stack)>0:
        p=stack.pop()
        a=k-p
        while len(tmpans)>0 and tmpans[-1][-1]>p:
            a+=tmpans[-1][0]
            tmpans.pop()
        tmpans.append([a,p])
x=[i[0] for i in tmpans]
print(sum(x))
print(len(x),*x) s=input() s input() input stack=[] stack [] tmpans=[] tmpans [] ans=[] ans [] for k,v in enumerate(s):
    if v=="\\":
        stack.append(k)
    elif v=="/" and len(stack)>0:
        p=stack.pop()
        a=k-p
        while len(tmpans)>0 and tmpans[-1][-1]>p:
            a+=tmpans[-1][0]
            tmpans.pop()
        tmpans.append([a,p]) k v enumerate(s) enumerate s if v=="\\":
        stack.append(k)
    elif v=="/" and len(stack)>0:
        p=stack.pop()
        a=k-p
        while len(tmpans)>0 and tmpans[-1][-1]>p:
            a+=tmpans[-1][0]
            tmpans.pop()
        tmpans.append([a,p]) v=="\\" v "\\" stack.append(k) stack.append stack append k elif v=="/" and len(stack)>0:
        p=stack.pop()
        a=k-p
        while len(tmpans)>0 and tmpans[-1][-1]>p:
            a+=tmpans[-1][0]
            tmpans.pop()
        tmpans.append([a,p]) v=="/" and len(stack)>0 v=="/" v "/" len(stack)>0 len(stack) len stack 0 p=stack.pop() p stack.pop() stack.pop stack pop a=k-p a k-p k p while len(tmpans)>0 and tmpans[-1][-1]>p:
            a+=tmpans[-1][0]
            tmpans.pop()
         len(tmpans)>0 and tmpans[-1][-1]>p len(tmpans)>0 len(tmpans) len tmpans 0 tmpans[-1][-1]>p tmpans[-1][-1] [-1] tmpans -1 -1 p a+=tmpans[-1][0] a tmpans[-1][0] [-1] tmpans -1 0 tmpans.pop() tmpans.pop tmpans pop tmpans.append([a,p]) tmpans.append tmpans append [a,p] a p i[0] for i in tmpans for i in tmpans i tmpans for i in tmpans i[0] i 0 x=[i[0] for i in tmpans] x [i[0] for i in tmpans] print(sum(x)) print sum(x) sum x print(len(x),*x) print len(x) len x *x x tmpans=[] [] tmpans a=k-p k-p a ans=[] [] ans stack=[] [] stack p=stack.pop() stack.pop() p s=input() input() s x=[i[0] for i in tmpans] [i[0] for i in tmpans] x a+=tmpans[-1][0] tmpans[-1][0] a
s=input()
stack=[]
tmpans=[]
ans=[]
for k,v in enumerate(s):
    if v=="\\":
        stack.append(k)
    elif v=="/" and len(stack)>0:
        p=stack.pop()
        a=k-p
        while len(tmpans)>0 and tmpans[-1][-1]>p:
            a+=tmpans[-1][0]
            tmpans.pop()
        tmpans.append([a,p])
x=[i[0] for i in tmpans]
print(sum(x))
print(len(x),*x)
