S = list(input())
areas = 0
cnt = 0
stack_1 = []
stack_2 = []

for i in range(len(S)):
    if S[i] == '\\':
        stack_1.append(i)
    elif S[i] == '/' and len(stack_1) > 0:
        j = stack_1.pop()
        area = i - j
        areas += area
        while len(stack_2) > 0 and stack_2[-1][0] > j:
            area += stack_2.pop()[1]
        stack_2.append([j, area])

print(areas)
if stack_2:
    print(len(stack_2), *list(zip(*stack_2))[1])
else:
    print(0)
     S = list(input()) S list(input()) list input() input areas = 0 areas 0 cnt = 0 cnt 0 stack_1 = [] stack_1 [] stack_2 = [] stack_2 [] for i in range(len(S)):
    if S[i] == '\\':
        stack_1.append(i)
    elif S[i] == '/' and len(stack_1) > 0:
        j = stack_1.pop()
        area = i - j
        areas += area
        while len(stack_2) > 0 and stack_2[-1][0] > j:
            area += stack_2.pop()[1]
        stack_2.append([j, area]) i range(len(S)) range len(S) len S if S[i] == '\\':
        stack_1.append(i)
    elif S[i] == '/' and len(stack_1) > 0:
        j = stack_1.pop()
        area = i - j
        areas += area
        while len(stack_2) > 0 and stack_2[-1][0] > j:
            area += stack_2.pop()[1]
        stack_2.append([j, area]) S[i] == '\\' S[i] S i '\\' stack_1.append(i) stack_1.append stack_1 append i elif S[i] == '/' and len(stack_1) > 0:
        j = stack_1.pop()
        area = i - j
        areas += area
        while len(stack_2) > 0 and stack_2[-1][0] > j:
            area += stack_2.pop()[1]
        stack_2.append([j, area]) S[i] == '/' and len(stack_1) > 0 S[i] == '/' S[i] S i '/' len(stack_1) > 0 len(stack_1) len stack_1 0 j = stack_1.pop() j stack_1.pop() stack_1.pop stack_1 pop area = i - j area i - j i j areas += area areas area while len(stack_2) > 0 and stack_2[-1][0] > j:
            area += stack_2.pop()[1]
         len(stack_2) > 0 and stack_2[-1][0] > j len(stack_2) > 0 len(stack_2) len stack_2 0 stack_2[-1][0] > j stack_2[-1][0] [-1] stack_2 -1 0 j area += stack_2.pop()[1] area stack_2.pop()[1] stack_2.pop() stack_2.pop stack_2 pop 1 stack_2.append([j, area]) stack_2.append stack_2 append [j, area] j area print(areas) print areas if stack_2:
    print(len(stack_2), *list(zip(*stack_2))[1])
else:
    print(0)
     stack_2 print(len(stack_2), *list(zip(*stack_2))[1]) print len(stack_2) len stack_2 *list(zip(*stack_2))[1] list(zip(*stack_2))[1] (zip(*stack_2)) list zip(*stack_2) zip *stack_2 stack_2 1 print(0) print 0 stack_1 = [] [] stack_1 area = i - j i - j area cnt = 0 0 cnt j = stack_1.pop() stack_1.pop() j areas = 0 0 areas stack_2 = [] [] stack_2 area += stack_2.pop()[1] stack_2.pop()[1] area S = list(input()) list(input()) S areas += area area areas
S = list(input())
areas = 0
cnt = 0
stack_1 = []
stack_2 = []

for i in range(len(S)):
    if S[i] == '\\':
        stack_1.append(i)
    elif S[i] == '/' and len(stack_1) > 0:
        j = stack_1.pop()
        area = i - j
        areas += area
        while len(stack_2) > 0 and stack_2[-1][0] > j:
            area += stack_2.pop()[1]
        stack_2.append([j, area])

print(areas)
if stack_2:
    print(len(stack_2), *list(zip(*stack_2))[1])
else:
    print(0)
    
