X = raw_input()
S1 = []
S2 = []
total = 0
for i, x in enumerate(X):
    if x == '\\':
        S1.append(i)
    elif x == '/' and len(S1) > 0:
        left = S1.pop()
        s = i - left
        total += s
        while len(S2) > 0:
            prev = S2.pop()
            if prev[0] < left:
                S2.append(prev)
                break
            else:
                s += prev[1]
        S2.append((left, s))
print total
result = [len(S2)]
for i in S2:
    result.append(i[1])
print ' '.join(map(str, result)) X = raw_input() X raw_input() raw_input S1 = [] S1 [] S2 = [] S2 [] total = 0 total 0 for i, x in enumerate(X):
    if x == '\\':
        S1.append(i)
    elif x == '/' and len(S1) > 0:
        left = S1.pop()
        s = i - left
        total += s
        while len(S2) > 0:
            prev = S2.pop()
            if prev[0] < left:
                S2.append(prev)
                break
            else:
                s += prev[1]
        S2.append((left, s)) i x enumerate(X) enumerate X if x == '\\':
        S1.append(i)
    elif x == '/' and len(S1) > 0:
        left = S1.pop()
        s = i - left
        total += s
        while len(S2) > 0:
            prev = S2.pop()
            if prev[0] < left:
                S2.append(prev)
                break
            else:
                s += prev[1]
        S2.append((left, s)) x == '\\' x '\\' S1.append(i) S1.append S1 append i elif x == '/' and len(S1) > 0:
        left = S1.pop()
        s = i - left
        total += s
        while len(S2) > 0:
            prev = S2.pop()
            if prev[0] < left:
                S2.append(prev)
                break
            else:
                s += prev[1]
        S2.append((left, s)) x == '/' and len(S1) > 0 x == '/' x '/' len(S1) > 0 len(S1) len S1 0 left = S1.pop() left S1.pop() S1.pop S1 pop s = i - left s i - left i left total += s total s while len(S2) > 0:
            prev = S2.pop()
            if prev[0] < left:
                S2.append(prev)
                break
            else:
                s += prev[1]
         len(S2) > 0 len(S2) len S2 0 prev = S2.pop() prev S2.pop() S2.pop S2 pop if prev[0] < left:
                S2.append(prev)
                break
            else:
                s += prev[1]
         prev[0] < left prev[0] prev 0 left S2.append(prev) S2.append S2 append prev break s += prev[1] s prev[1] prev 1 S2.append((left, s)) S2.append S2 append (left, s) left s print result = [len(S2)] result [len(S2)] len(S2) len S2 for i in S2:
    result.append(i[1]) i S2 result.append(i[1]) result.append result append i[1] i 1 print ' '.join(map(str, result)) ' '.join ' ' join map(str, result) map str result S2 = [] [] S2 X = raw_input() raw_input() X left = S1.pop() S1.pop() left total += s s total s += prev[1] prev[1] s s = i - left i - left s S1 = [] [] S1 result = [len(S2)] [len(S2)] result total = 0 0 total prev = S2.pop() S2.pop() prev
X = raw_input()
S1 = []
S2 = []
total = 0
for i, x in enumerate(X):
    if x == '\\':
        S1.append(i)
    elif x == '/' and len(S1) > 0:
        left = S1.pop()
        s = i - left
        total += s
        while len(S2) > 0:
            prev = S2.pop()
            if prev[0] < left:
                S2.append(prev)
                break
            else:
                s += prev[1]
        S2.append((left, s))
print total
result = [len(S2)]
for i in S2:
    result.append(i[1])
print ' '.join(map(str, result))