
danmen = input()
down = []
edge = []
pool = []

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

danmen = input()
down = []
edge = []
pool = []

for (i, line) in enumerate(danmen):
    if line == "\\":
        down.append(i)
    elif down and line == "/":
        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(len(pool), *pool)