S1 = []
S2= []
sum = 0
for i, s in enumerate(input()):
    if s == "\\":
        S1.append(i)
    elif s == "/" and len(S1) > 0:
        j = S1.pop()
        sum += i - j
        a = i - j
        while len(S2) > 0 and S2[-1][0] > j:
            a += S2.pop()[1]
        S2.append((j, a))
print(sum)
sum2 = [str(len(S2))]
for s in S2:
    sum2.append(str(s[1]))
print(" ".join(sum2))
 S1 = [] S1 [] S2= [] S2 [] sum = 0 sum 0 for i, s in enumerate(input()):
    if s == "\\":
        S1.append(i)
    elif s == "/" and len(S1) > 0:
        j = S1.pop()
        sum += i - j
        a = i - j
        while len(S2) > 0 and S2[-1][0] > j:
            a += S2.pop()[1]
        S2.append((j, a)) i s enumerate(input()) enumerate input() input if s == "\\":
        S1.append(i)
    elif s == "/" and len(S1) > 0:
        j = S1.pop()
        sum += i - j
        a = i - j
        while len(S2) > 0 and S2[-1][0] > j:
            a += S2.pop()[1]
        S2.append((j, a)) s == "\\" s "\\" S1.append(i) S1.append S1 append i elif s == "/" and len(S1) > 0:
        j = S1.pop()
        sum += i - j
        a = i - j
        while len(S2) > 0 and S2[-1][0] > j:
            a += S2.pop()[1]
        S2.append((j, a)) s == "/" and len(S1) > 0 s == "/" s "/" len(S1) > 0 len(S1) len S1 0 j = S1.pop() j S1.pop() S1.pop S1 pop sum += i - j sum i - j i j a = i - j a i - j i j while len(S2) > 0 and S2[-1][0] > j:
            a += S2.pop()[1]
         len(S2) > 0 and S2[-1][0] > j len(S2) > 0 len(S2) len S2 0 S2[-1][0] > j S2[-1][0] [-1] S2 -1 0 j a += S2.pop()[1] a S2.pop()[1] S2.pop() S2.pop S2 pop 1 S2.append((j, a)) S2.append S2 append (j, a) j a print(sum) print sum sum2 = [str(len(S2))] sum2 [str(len(S2))] str(len(S2)) str len(S2) len S2 for s in S2:
    sum2.append(str(s[1])) s S2 sum2.append(str(s[1])) sum2.append sum2 append str(s[1]) str s[1] s 1 print(" ".join(sum2)) print " ".join(sum2) " ".join " " join sum2 a += S2.pop()[1] S2.pop()[1] a S1 = [] [] S1 sum += i - j i - j sum a = i - j i - j a sum2 = [str(len(S2))] [str(len(S2))] sum2 sum = 0 0 sum j = S1.pop() S1.pop() j S2= [] [] S2
S1 = []
S2= []
sum = 0
for i, s in enumerate(input()):
    if s == "\\":
        S1.append(i)
    elif s == "/" and len(S1) > 0:
        j = S1.pop()
        sum += i - j
        a = i - j
        while len(S2) > 0 and S2[-1][0] > j:
            a += S2.pop()[1]
        S2.append((j, a))
print(sum)
sum2 = [str(len(S2))]
for s in S2:
    sum2.append(str(s[1]))
print(" ".join(sum2))

