down_positions = []
ponds = []
for index, value in enumerate(raw_input()):
    if value == '\\':
        down_positions.append(index)
    elif value == '/' and down_positions:
        right = index
        left = down_positions.pop()
        area = right - left
        candidate_area = 0
        while ponds and left < ponds[-1][0]:
           candidate_area += ponds.pop(-1)[1]

        ponds.append((left, area + candidate_area))

print sum(x[1] for x in ponds)
print len(ponds), 
for pond in ponds:
    print pond[1],  down_positions = [] down_positions [] ponds = [] ponds [] for index, value in enumerate(raw_input()):
    if value == '\\':
        down_positions.append(index)
    elif value == '/' and down_positions:
        right = index
        left = down_positions.pop()
        area = right - left
        candidate_area = 0
        while ponds and left < ponds[-1][0]:
           candidate_area += ponds.pop(-1)[1]

        ponds.append((left, area + candidate_area)) index value enumerate(raw_input()) enumerate raw_input() raw_input if value == '\\':
        down_positions.append(index)
    elif value == '/' and down_positions:
        right = index
        left = down_positions.pop()
        area = right - left
        candidate_area = 0
        while ponds and left < ponds[-1][0]:
           candidate_area += ponds.pop(-1)[1]

        ponds.append((left, area + candidate_area)) value == '\\' value '\\' down_positions.append(index) down_positions.append down_positions append index elif value == '/' and down_positions:
        right = index
        left = down_positions.pop()
        area = right - left
        candidate_area = 0
        while ponds and left < ponds[-1][0]:
           candidate_area += ponds.pop(-1)[1]

        ponds.append((left, area + candidate_area)) value == '/' and down_positions value == '/' value '/' down_positions right = index right index left = down_positions.pop() left down_positions.pop() down_positions.pop down_positions pop area = right - left area right - left right left candidate_area = 0 candidate_area 0 while ponds and left < ponds[-1][0]:
           candidate_area += ponds.pop(-1)[1]

         ponds and left < ponds[-1][0] ponds left < ponds[-1][0] left ponds[-1][0] [-1] ponds -1 0 candidate_area += ponds.pop(-1)[1] candidate_area ponds.pop(-1)[1] ponds.pop(-1) ponds.pop ponds pop -1 1 ponds.append((left, area + candidate_area)) ponds.append ponds append (left, area + candidate_area) left area + candidate_area area candidate_area print sum(x[1] for x in ponds) sum x[1] x 1 print len(ponds) len ponds for pond in ponds:
    print pond[1],  pond ponds print pond[1] pond 1 right = index index right area = right - left right - left area candidate_area = 0 0 candidate_area ponds = [] [] ponds left = down_positions.pop() down_positions.pop() left candidate_area += ponds.pop(-1)[1] ponds.pop(-1)[1] candidate_area down_positions = [] [] down_positions
down_positions = []
ponds = []
for index, value in enumerate(raw_input()):
    if value == '\\':
        down_positions.append(index)
    elif value == '/' and down_positions:
        right = index
        left = down_positions.pop()
        area = right - left
        candidate_area = 0
        while ponds and left < ponds[-1][0]:
           candidate_area += ponds.pop(-1)[1]

        ponds.append((left, area + candidate_area))

print sum(x[1] for x in ponds)
print len(ponds), 
for pond in ponds:
    print pond[1], 