square = input()
 
down = []
edge = []
pool = []
 
for i, strings in enumerate(square):
    if strings == "\\":
        down.append(i)
    elif down and strings == "/":
        left = down.pop()
        area = i - left
 
        while edge:
            if edge[-1] < left:
                break
            edge.pop()
            area += pool.pop()
 
        edge.append(left)
        pool.append(area)
 
print(sum(pool))
print(len(pool), *pool) square = input() square input() input down = [] down [] edge = [] edge [] pool = [] pool [] for i, strings in enumerate(square):
    if strings == "\\":
        down.append(i)
    elif down and strings == "/":
        left = down.pop()
        area = i - left
 
        while edge:
            if edge[-1] < left:
                break
            edge.pop()
            area += pool.pop()
 
        edge.append(left)
        pool.append(area)
  i strings enumerate(square) enumerate square if strings == "\\":
        down.append(i)
    elif down and strings == "/":
        left = down.pop()
        area = i - left
 
        while edge:
            if edge[-1] < left:
                break
            edge.pop()
            area += pool.pop()
 
        edge.append(left)
        pool.append(area)
  strings == "\\" strings "\\" down.append(i) down.append down append i elif down and strings == "/":
        left = down.pop()
        area = i - left
 
        while edge:
            if edge[-1] < left:
                break
            edge.pop()
            area += pool.pop()
 
        edge.append(left)
        pool.append(area)
  down and strings == "/" down strings == "/" strings "/" left = down.pop() left down.pop() down.pop down pop area = i - left area i - left i left while edge:
            if edge[-1] < left:
                break
            edge.pop()
            area += pool.pop()
 
         edge if edge[-1] < left:
                break
             edge[-1] < left edge[-1] edge -1 left break edge.pop() edge.pop edge pop area += pool.pop() area pool.pop() pool.pop pool pop 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(len(pool), *pool) print len(pool) len pool *pool pool square = input() input() square left = down.pop() down.pop() left down = [] [] down edge = [] [] edge area = i - left i - left area pool = [] [] pool area += pool.pop() pool.pop() area
square = input()
 
down = []
edge = []
pool = []
 
for i, strings in enumerate(square):
    if strings == "\\":
        down.append(i)
    elif down and strings == "/":
        left = down.pop()
        area = i - left
 
        while edge:
            if edge[-1] < left:
                break
            edge.pop()
            area += pool.pop()
 
        edge.append(left)
        pool.append(area)
 
print(sum(pool))
print(len(pool), *pool)