S = raw_input()

areas = []
stack = []
for i,c in enumerate(S):
    if c == "\\":
        stack.append(i)
    elif c == "/":
        if len(stack) > 0:
            j = stack.pop()
            area = i-j
            while len(areas) > 0:
                p,a = areas.pop()
                if j < p:
                    area += a
                else:
                    areas.append((p, a))
                    break
            areas.append((j, area))

A = map(lambda x:x[1], areas)
print sum(A)
if len(A) == 0:
    print "0"
else:
    print len(A), " ".join(map(str, A)) S = raw_input() S raw_input() raw_input areas = [] areas [] stack = [] stack [] for i,c in enumerate(S):
    if c == "\\":
        stack.append(i)
    elif c == "/":
        if len(stack) > 0:
            j = stack.pop()
            area = i-j
            while len(areas) > 0:
                p,a = areas.pop()
                if j < p:
                    area += a
                else:
                    areas.append((p, a))
                    break
            areas.append((j, area)) i c enumerate(S) enumerate S if c == "\\":
        stack.append(i)
    elif c == "/":
        if len(stack) > 0:
            j = stack.pop()
            area = i-j
            while len(areas) > 0:
                p,a = areas.pop()
                if j < p:
                    area += a
                else:
                    areas.append((p, a))
                    break
            areas.append((j, area)) c == "\\" c "\\" stack.append(i) stack.append stack append i elif c == "/":
        if len(stack) > 0:
            j = stack.pop()
            area = i-j
            while len(areas) > 0:
                p,a = areas.pop()
                if j < p:
                    area += a
                else:
                    areas.append((p, a))
                    break
            areas.append((j, area)) c == "/" c "/" if len(stack) > 0:
            j = stack.pop()
            area = i-j
            while len(areas) > 0:
                p,a = areas.pop()
                if j < p:
                    area += a
                else:
                    areas.append((p, a))
                    break
            areas.append((j, area)) len(stack) > 0 len(stack) len stack 0 j = stack.pop() j stack.pop() stack.pop stack pop area = i-j area i-j i j while len(areas) > 0:
                p,a = areas.pop()
                if j < p:
                    area += a
                else:
                    areas.append((p, a))
                    break
             len(areas) > 0 len(areas) len areas 0 p,a = areas.pop() p areas.pop() areas.pop areas pop a if j < p:
                    area += a
                else:
                    areas.append((p, a))
                    break
             j < p j p area += a area a areas.append((p, a)) areas.append areas append (p, a) p a break areas.append((j, area)) areas.append areas append (j, area) j area A = map(lambda x:x[1], areas) A map(lambda x:x[1], areas) map lambda x:x[1] x[1] x 1 x areas print sum(A) sum A if len(A) == 0:
    print "0"
else:
    print len(A), " ".join(map(str, A)) len(A) == 0 len(A) len A 0 print print len(A) len A " ".join(map(str, A)) " ".join " " join map(str, A) map str A area = i-j i-j area p,a = areas.pop() areas.pop() p a = areas.pop() areas.pop() a stack = [] [] stack S = raw_input() raw_input() S j = stack.pop() stack.pop() j A = map(lambda x:x[1], areas) map(lambda x:x[1], areas) A area += a a area areas = [] [] areas
S = raw_input()

areas = []
stack = []
for i,c in enumerate(S):
    if c == "\\":
        stack.append(i)
    elif c == "/":
        if len(stack) > 0:
            j = stack.pop()
            area = i-j
            while len(areas) > 0:
                p,a = areas.pop()
                if j < p:
                    area += a
                else:
                    areas.append((p, a))
                    break
            areas.append((j, area))

A = map(lambda x:x[1], areas)
print sum(A)
if len(A) == 0:
    print "0"
else:
    print len(A), " ".join(map(str, A))
