down = []
edge = []
pool = []
for i,c in enumerate(input()):
    if c == "\\":
        down.append(i)
    elif c == "/" and down:
        left = down.pop()
        area = i - left
        
        while edge:
            if edge[-1] > left:
                edge.pop()
                area += pool.pop()
            else:
                break
        
        edge.append(left)
        pool.append(area)
print(sum(pool))
print(" ".join(map(str,[len(pool)]+pool)))
 down = [] down [] edge = [] edge [] pool = [] pool [] for i,c in enumerate(input()):
    if c == "\\":
        down.append(i)
    elif c == "/" and down:
        left = down.pop()
        area = i - left
        
        while edge:
            if edge[-1] > left:
                edge.pop()
                area += pool.pop()
            else:
                break
        
        edge.append(left)
        pool.append(area) i c enumerate(input()) enumerate input() input if c == "\\":
        down.append(i)
    elif c == "/" and down:
        left = down.pop()
        area = i - left
        
        while edge:
            if edge[-1] > left:
                edge.pop()
                area += pool.pop()
            else:
                break
        
        edge.append(left)
        pool.append(area) c == "\\" c "\\" down.append(i) down.append down append i elif c == "/" and down:
        left = down.pop()
        area = i - left
        
        while edge:
            if edge[-1] > left:
                edge.pop()
                area += pool.pop()
            else:
                break
        
        edge.append(left)
        pool.append(area) c == "/" and down c == "/" c "/" down left = down.pop() left down.pop() down.pop down pop area = i - left area i - left i left while edge:
            if edge[-1] > left:
                edge.pop()
                area += pool.pop()
            else:
                break
        
         edge if edge[-1] > left:
                edge.pop()
                area += pool.pop()
            else:
                break
        
         edge[-1] > left edge[-1] edge -1 left edge.pop() edge.pop edge pop area += pool.pop() area pool.pop() pool.pop pool pop break edge.append(left) edge.append edge append left pool.append(area) pool.append pool append area print(sum(pool)) print sum(pool) sum pool print(" ".join(map(str,[len(pool)]+pool))) print " ".join(map(str,[len(pool)]+pool)) " ".join " " join map(str,[len(pool)]+pool) map str [len(pool)]+pool [len(pool)] len(pool) len pool pool left = down.pop() down.pop() left pool = [] [] pool area = i - left i - left area area += pool.pop() pool.pop() area down = [] [] down edge = [] [] edge
down = []
edge = []
pool = []
for i,c in enumerate(input()):
    if c == "\\":
        down.append(i)
    elif c == "/" and down:
        left = down.pop()
        area = i - left
        
        while edge:
            if edge[-1] > left:
                edge.pop()
                area += pool.pop()
            else:
                break
        
        edge.append(left)
        pool.append(area)
print(sum(pool))
print(" ".join(map(str,[len(pool)]+pool)))

