line = input()
stack, edges, pools = [], [], []

for i in range(len(line)):
    if line[i] == '\\':
        stack.append(i)
    elif line[i] == '/' and stack:
        j = stack.pop()
        tmp = i - j
        while edges and edges[-1] > j:
            edges.pop()
            tmp += pools.pop()
        edges.append(j)
        pools.append(tmp)

print(sum(pools))
print(len(pools), *pools) line = input() line input() input stack, edges, pools = [], [], [] stack [] edges [] pools [] for i in range(len(line)):
    if line[i] == '\\':
        stack.append(i)
    elif line[i] == '/' and stack:
        j = stack.pop()
        tmp = i - j
        while edges and edges[-1] > j:
            edges.pop()
            tmp += pools.pop()
        edges.append(j)
        pools.append(tmp) i range(len(line)) range len(line) len line if line[i] == '\\':
        stack.append(i)
    elif line[i] == '/' and stack:
        j = stack.pop()
        tmp = i - j
        while edges and edges[-1] > j:
            edges.pop()
            tmp += pools.pop()
        edges.append(j)
        pools.append(tmp) line[i] == '\\' line[i] line i '\\' stack.append(i) stack.append stack append i elif line[i] == '/' and stack:
        j = stack.pop()
        tmp = i - j
        while edges and edges[-1] > j:
            edges.pop()
            tmp += pools.pop()
        edges.append(j)
        pools.append(tmp) line[i] == '/' and stack line[i] == '/' line[i] line i '/' stack j = stack.pop() j stack.pop() stack.pop stack pop tmp = i - j tmp i - j i j while edges and edges[-1] > j:
            edges.pop()
            tmp += pools.pop()
         edges and edges[-1] > j edges edges[-1] > j edges[-1] edges -1 j edges.pop() edges.pop edges pop tmp += pools.pop() tmp pools.pop() pools.pop pools pop edges.append(j) edges.append edges append j pools.append(tmp) pools.append pools append tmp print(sum(pools)) print sum(pools) sum pools print(len(pools), *pools) print len(pools) len pools *pools pools pools = [], [], [] [] pools j = stack.pop() stack.pop() j line = input() input() line stack, edges, pools = [], [], [] [] stack edges, pools = [], [], [] [] edges tmp = i - j i - j tmp tmp += pools.pop() pools.pop() tmp
line = input()
stack, edges, pools = [], [], []

for i in range(len(line)):
    if line[i] == '\\':
        stack.append(i)
    elif line[i] == '/' and stack:
        j = stack.pop()
        tmp = i - j
        while edges and edges[-1] > j:
            edges.pop()
            tmp += pools.pop()
        edges.append(j)
        pools.append(tmp)

print(sum(pools))
print(len(pools), *pools)