visited = {0: -1}
height = 0
pools = []
for i, c in enumerate(input()):
    if c == '\\':
        height -= 1
    elif c == '/':
        height += 1
        if height in visited:
            width = i - visited[height]
            sm = 0
            while pools and pools[-1][0] > visited[height]:
                x, l = pools.pop()
                sm += l
            pools.append((i, sm + width - 1))
    visited[height] = i

print(sum(l for x, l in pools))
if pools:
    print(len(pools), ' '.join(str(l) for x, l in pools))
else:
    print(0) visited = {0: -1} visited {0: -1} 0 0 -1 height = 0 height 0 pools = [] pools [] for i, c in enumerate(input()):
    if c == '\\':
        height -= 1
    elif c == '/':
        height += 1
        if height in visited:
            width = i - visited[height]
            sm = 0
            while pools and pools[-1][0] > visited[height]:
                x, l = pools.pop()
                sm += l
            pools.append((i, sm + width - 1))
    visited[height] = i i c enumerate(input()) enumerate input() input if c == '\\':
        height -= 1
    elif c == '/':
        height += 1
        if height in visited:
            width = i - visited[height]
            sm = 0
            while pools and pools[-1][0] > visited[height]:
                x, l = pools.pop()
                sm += l
            pools.append((i, sm + width - 1))
     c == '\\' c '\\' height -= 1 height 1 elif c == '/':
        height += 1
        if height in visited:
            width = i - visited[height]
            sm = 0
            while pools and pools[-1][0] > visited[height]:
                x, l = pools.pop()
                sm += l
            pools.append((i, sm + width - 1))
     c == '/' c '/' height += 1 height 1 if height in visited:
            width = i - visited[height]
            sm = 0
            while pools and pools[-1][0] > visited[height]:
                x, l = pools.pop()
                sm += l
            pools.append((i, sm + width - 1))
     height in visited height visited width = i - visited[height] width i - visited[height] i visited[height] visited height sm = 0 sm 0 while pools and pools[-1][0] > visited[height]:
                x, l = pools.pop()
                sm += l
             pools and pools[-1][0] > visited[height] pools pools[-1][0] > visited[height] pools[-1][0] [-1] pools -1 0 visited[height] visited height x, l = pools.pop() x pools.pop() pools.pop pools pop l sm += l sm l pools.append((i, sm + width - 1)) pools.append pools append (i, sm + width - 1) i sm + width - 1 sm + width sm width 1 visited[height] = i visited[height] visited height i print(sum(l for x, l in pools)) print sum(l for x, l in pools) sum l if pools:
    print(len(pools), ' '.join(str(l) for x, l in pools))
else:
    print(0) pools print(len(pools), ' '.join(str(l) for x, l in pools)) print len(pools) len pools ' '.join(str(l) for x, l in pools) ' '.join ' ' join str(l) str l print(0) print 0 sm += l l sm height -= 1 1 height height += 1 1 height width = i - visited[height] i - visited[height] width l = pools.pop() pools.pop() l sm = 0 0 sm x, l = pools.pop() pools.pop() x height = 0 0 height pools = [] [] pools visited = {0: -1} {0: -1} visited
visited = {0: -1}
height = 0
pools = []
for i, c in enumerate(input()):
    if c == '\\':
        height -= 1
    elif c == '/':
        height += 1
        if height in visited:
            width = i - visited[height]
            sm = 0
            while pools and pools[-1][0] > visited[height]:
                x, l = pools.pop()
                sm += l
            pools.append((i, sm + width - 1))
    visited[height] = i

print(sum(l for x, l in pools))
if pools:
    print(len(pools), ' '.join(str(l) for x, l in pools))
else:
    print(0)