li1 = []
li2 = []
ans = 0
for i, s in enumerate(input()):
    if s == "\\":
        li1.append(i)
    elif s == "/" and li1:
        j = li1.pop()
        c = i - j
        ans += c
        while li2 and li2[-1][0] > j:
            c += li2[-1][1]
            li2.pop()
        li2.append((j, c))
print(ans)
if li2:
    print(len(li2), *list(zip(*li2))[1])
else:
    print(0)
 li1 = [] li1 [] li2 = [] li2 [] ans = 0 ans 0 for i, s in enumerate(input()):
    if s == "\\":
        li1.append(i)
    elif s == "/" and li1:
        j = li1.pop()
        c = i - j
        ans += c
        while li2 and li2[-1][0] > j:
            c += li2[-1][1]
            li2.pop()
        li2.append((j, c)) i s enumerate(input()) enumerate input() input if s == "\\":
        li1.append(i)
    elif s == "/" and li1:
        j = li1.pop()
        c = i - j
        ans += c
        while li2 and li2[-1][0] > j:
            c += li2[-1][1]
            li2.pop()
        li2.append((j, c)) s == "\\" s "\\" li1.append(i) li1.append li1 append i elif s == "/" and li1:
        j = li1.pop()
        c = i - j
        ans += c
        while li2 and li2[-1][0] > j:
            c += li2[-1][1]
            li2.pop()
        li2.append((j, c)) s == "/" and li1 s == "/" s "/" li1 j = li1.pop() j li1.pop() li1.pop li1 pop c = i - j c i - j i j ans += c ans c while li2 and li2[-1][0] > j:
            c += li2[-1][1]
            li2.pop()
         li2 and li2[-1][0] > j li2 li2[-1][0] > j li2[-1][0] [-1] li2 -1 0 j c += li2[-1][1] c li2[-1][1] [-1] li2 -1 1 li2.pop() li2.pop li2 pop li2.append((j, c)) li2.append li2 append (j, c) j c print(ans) print ans if li2:
    print(len(li2), *list(zip(*li2))[1])
else:
    print(0) li2 print(len(li2), *list(zip(*li2))[1]) print len(li2) len li2 *list(zip(*li2))[1] list(zip(*li2))[1] (zip(*li2)) list zip(*li2) zip *li2 li2 1 print(0) print 0 li1 = [] [] li1 ans = 0 0 ans c = i - j i - j c ans += c c ans j = li1.pop() li1.pop() j c += li2[-1][1] li2[-1][1] c li2 = [] [] li2
li1 = []
li2 = []
ans = 0
for i, s in enumerate(input()):
    if s == "\\":
        li1.append(i)
    elif s == "/" and li1:
        j = li1.pop()
        c = i - j
        ans += c
        while li2 and li2[-1][0] > j:
            c += li2[-1][1]
            li2.pop()
        li2.append((j, c))
print(ans)
if li2:
    print(len(li2), *list(zip(*li2))[1])
else:
    print(0)

