# l = open('input.txt').readline()
l = input()

k = 0
S1, S2 = [], []
for i in range(len(l)):
    if l[i] == '\\':
        S1.append(i)
    elif l[i] == '/' and S1:
        j = S1.pop()
        a = i - j
        k += i - j

        while S2 and S2[-1][0] > j:
            a += S2.pop()[1]
        S2.append((j, a))
print(k)
print(len(S2), *(a for j, a in S2)) l = input() l input() input k = 0 k 0 S1, S2 = [], [] S1 [] S2 [] for i in range(len(l)):
    if l[i] == '\\':
        S1.append(i)
    elif l[i] == '/' and S1:
        j = S1.pop()
        a = i - j
        k += i - j

        while S2 and S2[-1][0] > j:
            a += S2.pop()[1]
        S2.append((j, a)) i range(len(l)) range len(l) len l if l[i] == '\\':
        S1.append(i)
    elif l[i] == '/' and S1:
        j = S1.pop()
        a = i - j
        k += i - j

        while S2 and S2[-1][0] > j:
            a += S2.pop()[1]
        S2.append((j, a)) l[i] == '\\' l[i] l i '\\' S1.append(i) S1.append S1 append i elif l[i] == '/' and S1:
        j = S1.pop()
        a = i - j
        k += i - j

        while S2 and S2[-1][0] > j:
            a += S2.pop()[1]
        S2.append((j, a)) l[i] == '/' and S1 l[i] == '/' l[i] l i '/' S1 j = S1.pop() j S1.pop() S1.pop S1 pop a = i - j a i - j i j k += i - j k i - j i j while S2 and S2[-1][0] > j:
            a += S2.pop()[1]
         S2 and S2[-1][0] > j S2 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(k) print k a for j, a in S2 for j, a in S2 j a S2 for j, a in S2 a print(len(S2), *(a for j, a in S2)) print len(S2) len S2 *(a for j, a in S2) (a for j, a in S2) S2 = [], [] [] S2 a = i - j i - j a l = input() input() l S1, S2 = [], [] [] S1 k += i - j i - j k j = S1.pop() S1.pop() j a += S2.pop()[1] S2.pop()[1] a k = 0 0 k
# l = open('input.txt').readline()
l = input()

k = 0
S1, S2 = [], []
for i in range(len(l)):
    if l[i] == '\\':
        S1.append(i)
    elif l[i] == '/' and S1:
        j = S1.pop()
        a = i - j
        k += i - j

        while S2 and S2[-1][0] > j:
            a += S2.pop()[1]
        S2.append((j, a))
print(k)
print(len(S2), *(a for j, a in S2))