li1 = []
li2 = []
for i, s in enumerate(input()):
    if s == "\\":
        li1.append(i)
    elif s == "/" and li1:
        j = li1.pop()
        c = i - j
        while li2 and li2[-1][0] > j:
            c += li2[-1][1]
            li2.pop()
        li2.append((j, c))
if li2:
    li3 = list(zip(*li2))[1]
    print(sum(li3))
    print(len(li3), *li3)
else:
    print(0, 0, sep="\n")
 li1 = [] li1 [] li2 = [] li2 [] for i, s in enumerate(input()):
    if s == "\\":
        li1.append(i)
    elif s == "/" and li1:
        j = li1.pop()
        c = i - j
        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
        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
        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 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 if li2:
    li3 = list(zip(*li2))[1]
    print(sum(li3))
    print(len(li3), *li3)
else:
    print(0, 0, sep="\n") li2 li3 = list(zip(*li2))[1] li3 list(zip(*li2))[1] (zip(*li2)) list zip(*li2) zip *li2 li2 1 print(sum(li3)) print sum(li3) sum li3 print(len(li3), *li3) print len(li3) len li3 *li3 li3 print(0, 0, sep="\n") print 0 0 sep="\n" sep "\n" c = i - j i - j c li3 = list(zip(*li2))[1] list(zip(*li2))[1] li3 c += li2[-1][1] li2[-1][1] c li2 = [] [] li2 j = li1.pop() li1.pop() j li1 = [] [] li1
li1 = []
li2 = []
for i, s in enumerate(input()):
    if s == "\\":
        li1.append(i)
    elif s == "/" and li1:
        j = li1.pop()
        c = i - j
        while li2 and li2[-1][0] > j:
            c += li2[-1][1]
            li2.pop()
        li2.append((j, c))
if li2:
    li3 = list(zip(*li2))[1]
    print(sum(li3))
    print(len(li3), *li3)
else:
    print(0, 0, sep="\n")

