cross_section = input()

stack = []
areas_stack = []
area = 0
for i in range(len(cross_section)):
    c = cross_section[i]
    if c == '\\':
        stack.append(i)
    elif c == '/' and len(stack) != 0:
        j = stack.pop()
        a = i - j
        area += a
        while len(areas_stack) != 0 and areas_stack[-1][0] > j:
            a += areas_stack.pop()[1]
        areas_stack.append([j, a])

print(area)
if area == 0:
    print(0)
else:
    print(len(areas_stack), ' '.join([str(x[1]) for x in areas_stack]))
 cross_section = input() cross_section input() input stack = [] stack [] areas_stack = [] areas_stack [] area = 0 area 0 for i in range(len(cross_section)):
    c = cross_section[i]
    if c == '\\':
        stack.append(i)
    elif c == '/' and len(stack) != 0:
        j = stack.pop()
        a = i - j
        area += a
        while len(areas_stack) != 0 and areas_stack[-1][0] > j:
            a += areas_stack.pop()[1]
        areas_stack.append([j, a]) i range(len(cross_section)) range len(cross_section) len cross_section c = cross_section[i] c cross_section[i] cross_section i if c == '\\':
        stack.append(i)
    elif c == '/' and len(stack) != 0:
        j = stack.pop()
        a = i - j
        area += a
        while len(areas_stack) != 0 and areas_stack[-1][0] > j:
            a += areas_stack.pop()[1]
        areas_stack.append([j, a]) c == '\\' c '\\' stack.append(i) stack.append stack append i elif c == '/' and len(stack) != 0:
        j = stack.pop()
        a = i - j
        area += a
        while len(areas_stack) != 0 and areas_stack[-1][0] > j:
            a += areas_stack.pop()[1]
        areas_stack.append([j, a]) c == '/' and len(stack) != 0 c == '/' c '/' len(stack) != 0 len(stack) len stack 0 j = stack.pop() j stack.pop() stack.pop stack pop a = i - j a i - j i j area += a area a while len(areas_stack) != 0 and areas_stack[-1][0] > j:
            a += areas_stack.pop()[1]
         len(areas_stack) != 0 and areas_stack[-1][0] > j len(areas_stack) != 0 len(areas_stack) len areas_stack 0 areas_stack[-1][0] > j areas_stack[-1][0] [-1] areas_stack -1 0 j a += areas_stack.pop()[1] a areas_stack.pop()[1] areas_stack.pop() areas_stack.pop areas_stack pop 1 areas_stack.append([j, a]) areas_stack.append areas_stack append [j, a] j a print(area) print area if area == 0:
    print(0)
else:
    print(len(areas_stack), ' '.join([str(x[1]) for x in areas_stack])) area == 0 area 0 print(0) print 0 str(x[1]) for x in areas_stack for x in areas_stack x areas_stack for x in areas_stack str(x[1]) str x[1] x 1 print(len(areas_stack), ' '.join([str(x[1]) for x in areas_stack])) print len(areas_stack) len areas_stack ' '.join([str(x[1]) for x in areas_stack]) ' '.join ' ' join [str(x[1]) for x in areas_stack] a = i - j i - j a stack = [] [] stack areas_stack = [] [] areas_stack c = cross_section[i] cross_section[i] c j = stack.pop() stack.pop() j a += areas_stack.pop()[1] areas_stack.pop()[1] a cross_section = input() input() cross_section area = 0 0 area area += a a area
cross_section = input()

stack = []
areas_stack = []
area = 0
for i in range(len(cross_section)):
    c = cross_section[i]
    if c == '\\':
        stack.append(i)
    elif c == '/' and len(stack) != 0:
        j = stack.pop()
        a = i - j
        area += a
        while len(areas_stack) != 0 and areas_stack[-1][0] > j:
            a += areas_stack.pop()[1]
        areas_stack.append([j, a])

print(area)
if area == 0:
    print(0)
else:
    print(len(areas_stack), ' '.join([str(x[1]) for x in areas_stack]))

