x = input()
S1 = []
S2 = []
current_position = 0
total_area = 0

for i in x:
    if i == '\\':
        S1.append(current_position)

    elif i == '/':
        try:
            start_position = S1.pop()
            distance = current_position - start_position
            total_area += distance
            S2.append([start_position, distance])

        except:
            continue

    current_position += 1

print(total_area)

S2.insert(0, [-1, -1])
S3 = []
if len(S2) == 1:print(0)
else:
    for i in range(len(S2)-1, -1, -1):
        x, y = S2[i]
        px, py = S2[i-1]
        if x < px:
            S2[i-1] = [x, y + py]
        else:
            S3.append(S2[i])

    print(len(S3), *[j for i, j in S3[::-1]]) x = input() x input() input S1 = [] S1 [] S2 = [] S2 [] current_position = 0 current_position 0 total_area = 0 total_area 0 for i in x:
    if i == '\\':
        S1.append(current_position)

    elif i == '/':
        try:
            start_position = S1.pop()
            distance = current_position - start_position
            total_area += distance
            S2.append([start_position, distance])

        except:
            continue

    current_position += 1 i x if i == '\\':
        S1.append(current_position)

    elif i == '/':
        try:
            start_position = S1.pop()
            distance = current_position - start_position
            total_area += distance
            S2.append([start_position, distance])

        except:
            continue

     i == '\\' i '\\' S1.append(current_position) S1.append S1 append current_position elif i == '/':
        try:
            start_position = S1.pop()
            distance = current_position - start_position
            total_area += distance
            S2.append([start_position, distance])

        except:
            continue

     i == '/' i '/' try:
            start_position = S1.pop()
            distance = current_position - start_position
            total_area += distance
            S2.append([start_position, distance])

        except:
            continue

     except:
            continue

     continue start_position = S1.pop() start_position S1.pop() S1.pop S1 pop distance = current_position - start_position distance current_position - start_position current_position start_position total_area += distance total_area distance S2.append([start_position, distance]) S2.append S2 append [start_position, distance] start_position distance current_position += 1 current_position 1 print(total_area) print total_area S2.insert(0, [-1, -1]) S2.insert S2 insert 0 [-1, -1] -1 -1 S3 = [] S3 [] if len(S2) == 1:print(0)
else:
    for i in range(len(S2)-1, -1, -1):
        x, y = S2[i]
        px, py = S2[i-1]
        if x < px:
            S2[i-1] = [x, y + py]
        else:
            S3.append(S2[i])

    print(len(S3), *[j for i, j in S3[::-1]]) len(S2) == 1 len(S2) len S2 1 for i in range(len(S2)-1, -1, -1):
        x, y = S2[i]
        px, py = S2[i-1]
        if x < px:
            S2[i-1] = [x, y + py]
        else:
            S3.append(S2[i])

     i range(len(S2)-1, -1, -1) range len(S2)-1 len(S2) len S2 1 -1 -1 x, y = S2[i] x S2[i] S2 i y px, py = S2[i-1] px S2[i-1] S2 i-1 i 1 py if x < px:
            S2[i-1] = [x, y + py]
        else:
            S3.append(S2[i])

     x < px x px S2[i-1] = [x, y + py] S2[i-1] S2 i-1 i 1 [x, y + py] x y + py y py S3.append(S2[i]) S3.append S3 append S2[i] S2 i j for i, j in S3[::-1] for i, j in S3[::-1] i j S3[::-1] S3 ::-1 -1 for i, j in S3[::-1] j print(len(S3), *[j for i, j in S3[::-1]]) print len(S3) len S3 *[j for i, j in S3[::-1]] [j for i, j in S3[::-1]] x = input() input() x start_position = S1.pop() S1.pop() start_position py = S2[i-1] S2[i-1] py current_position = 0 0 current_position y = S2[i] S2[i] y distance = current_position - start_position current_position - start_position distance current_position += 1 1 current_position S2 = [] [] S2 S3 = [] [] S3 total_area = 0 0 total_area px, py = S2[i-1] S2[i-1] px total_area += distance distance total_area x, y = S2[i] S2[i] x S1 = [] [] S1
x = input()
S1 = []
S2 = []
current_position = 0
total_area = 0

for i in x:
    if i == '\\':
        S1.append(current_position)

    elif i == '/':
        try:
            start_position = S1.pop()
            distance = current_position - start_position
            total_area += distance
            S2.append([start_position, distance])

        except:
            continue

    current_position += 1

print(total_area)

S2.insert(0, [-1, -1])
S3 = []
if len(S2) == 1:print(0)
else:
    for i in range(len(S2)-1, -1, -1):
        x, y = S2[i]
        px, py = S2[i-1]
        if x < px:
            S2[i-1] = [x, y + py]
        else:
            S3.append(S2[i])

    print(len(S3), *[j for i, j in S3[::-1]])
