dan = list(input())
wid = len(dan)
stack_s1 = list()
stack_s2 = list()

for i in range(wid):
    if dan[i] == '\\':
        stack_s1.append(i)
    if len(stack_s1) > 0 and dan[i] == '/':
        j = stack_s1.pop()
        men = i - j
        while len(stack_s2) > 0 and j < stack_s2[-1][0]:
            tmp = stack_s2.pop()
            men += tmp[1]
        stack_s2.append([j, men])

t_men = 0
k = list()
k.append(str(len(stack_s2)))
for i, j in stack_s2:
    t_men += j
    k.append(str(j))
print(t_men)
print(' '.join(k))
 dan = list(input()) dan list(input()) list input() input wid = len(dan) wid len(dan) len dan stack_s1 = list() stack_s1 list() list stack_s2 = list() stack_s2 list() list for i in range(wid):
    if dan[i] == '\\':
        stack_s1.append(i)
    if len(stack_s1) > 0 and dan[i] == '/':
        j = stack_s1.pop()
        men = i - j
        while len(stack_s2) > 0 and j < stack_s2[-1][0]:
            tmp = stack_s2.pop()
            men += tmp[1]
        stack_s2.append([j, men]) i range(wid) range wid if dan[i] == '\\':
        stack_s1.append(i)
     dan[i] == '\\' dan[i] dan i '\\' stack_s1.append(i) stack_s1.append stack_s1 append i if len(stack_s1) > 0 and dan[i] == '/':
        j = stack_s1.pop()
        men = i - j
        while len(stack_s2) > 0 and j < stack_s2[-1][0]:
            tmp = stack_s2.pop()
            men += tmp[1]
        stack_s2.append([j, men]) len(stack_s1) > 0 and dan[i] == '/' len(stack_s1) > 0 len(stack_s1) len stack_s1 0 dan[i] == '/' dan[i] dan i '/' j = stack_s1.pop() j stack_s1.pop() stack_s1.pop stack_s1 pop men = i - j men i - j i j while len(stack_s2) > 0 and j < stack_s2[-1][0]:
            tmp = stack_s2.pop()
            men += tmp[1]
         len(stack_s2) > 0 and j < stack_s2[-1][0] len(stack_s2) > 0 len(stack_s2) len stack_s2 0 j < stack_s2[-1][0] j stack_s2[-1][0] [-1] stack_s2 -1 0 tmp = stack_s2.pop() tmp stack_s2.pop() stack_s2.pop stack_s2 pop men += tmp[1] men tmp[1] tmp 1 stack_s2.append([j, men]) stack_s2.append stack_s2 append [j, men] j men t_men = 0 t_men 0 k = list() k list() list k.append(str(len(stack_s2))) k.append k append str(len(stack_s2)) str len(stack_s2) len stack_s2 for i, j in stack_s2:
    t_men += j
    k.append(str(j)) i j stack_s2 t_men += j t_men j k.append(str(j)) k.append k append str(j) str j print(t_men) print t_men print(' '.join(k)) print ' '.join(k) ' '.join ' ' join k t_men = 0 0 t_men stack_s1 = list() list() stack_s1 men += tmp[1] tmp[1] men j = stack_s1.pop() stack_s1.pop() j tmp = stack_s2.pop() stack_s2.pop() tmp wid = len(dan) len(dan) wid t_men += j j t_men stack_s2 = list() list() stack_s2 dan = list(input()) list(input()) dan men = i - j i - j men k = list() list() k
dan = list(input())
wid = len(dan)
stack_s1 = list()
stack_s2 = list()

for i in range(wid):
    if dan[i] == '\\':
        stack_s1.append(i)
    if len(stack_s1) > 0 and dan[i] == '/':
        j = stack_s1.pop()
        men = i - j
        while len(stack_s2) > 0 and j < stack_s2[-1][0]:
            tmp = stack_s2.pop()
            men += tmp[1]
        stack_s2.append([j, men])

t_men = 0
k = list()
k.append(str(len(stack_s2)))
for i, j in stack_s2:
    t_men += j
    k.append(str(j))
print(t_men)
print(' '.join(k))

