# coding=utf-8

S1 = []
S2 = []
total_square = 0
j = 0

input = list(input())

for i, val in enumerate(input):
    sq = 0
    if val == '\\':
        S1.append(i)
    elif val == '/':
        if len(S1) > 0:
            j = S1.pop()
            total_square += (i - j)
            if len(S2) > 0:
                if (S2[-1][0] > j):
                    while (S2[-1][0] > j):
                        poped = S2.pop()
                        sq += poped[1]
                        if len(S2) == 0:
                            break
                    S2.append([j, sq + (i-j)])
                else:
                    S2.append([j, (i-j)])
            else:
                S2.append([j, i-j])

print(total_square)
print(len(S2), end = "")
for data in S2:
    print(' ' + str(data[1]), end = "")
print() S1 = [] S1 [] S2 = [] S2 [] total_square = 0 total_square 0 j = 0 j 0 input = list(input()) input list(input()) list input() input for i, val in enumerate(input):
    sq = 0
    if val == '\\':
        S1.append(i)
    elif val == '/':
        if len(S1) > 0:
            j = S1.pop()
            total_square += (i - j)
            if len(S2) > 0:
                if (S2[-1][0] > j):
                    while (S2[-1][0] > j):
                        poped = S2.pop()
                        sq += poped[1]
                        if len(S2) == 0:
                            break
                    S2.append([j, sq + (i-j)])
                else:
                    S2.append([j, (i-j)])
            else:
                S2.append([j, i-j]) i val enumerate(input) enumerate input sq = 0 sq 0 if val == '\\':
        S1.append(i)
    elif val == '/':
        if len(S1) > 0:
            j = S1.pop()
            total_square += (i - j)
            if len(S2) > 0:
                if (S2[-1][0] > j):
                    while (S2[-1][0] > j):
                        poped = S2.pop()
                        sq += poped[1]
                        if len(S2) == 0:
                            break
                    S2.append([j, sq + (i-j)])
                else:
                    S2.append([j, (i-j)])
            else:
                S2.append([j, i-j]) val == '\\' val '\\' S1.append(i) S1.append S1 append i elif val == '/':
        if len(S1) > 0:
            j = S1.pop()
            total_square += (i - j)
            if len(S2) > 0:
                if (S2[-1][0] > j):
                    while (S2[-1][0] > j):
                        poped = S2.pop()
                        sq += poped[1]
                        if len(S2) == 0:
                            break
                    S2.append([j, sq + (i-j)])
                else:
                    S2.append([j, (i-j)])
            else:
                S2.append([j, i-j]) val == '/' val '/' if len(S1) > 0:
            j = S1.pop()
            total_square += (i - j)
            if len(S2) > 0:
                if (S2[-1][0] > j):
                    while (S2[-1][0] > j):
                        poped = S2.pop()
                        sq += poped[1]
                        if len(S2) == 0:
                            break
                    S2.append([j, sq + (i-j)])
                else:
                    S2.append([j, (i-j)])
            else:
                S2.append([j, i-j]) len(S1) > 0 len(S1) len S1 0 j = S1.pop() j S1.pop() S1.pop S1 pop total_square += (i - j) total_square i - j i j if len(S2) > 0:
                if (S2[-1][0] > j):
                    while (S2[-1][0] > j):
                        poped = S2.pop()
                        sq += poped[1]
                        if len(S2) == 0:
                            break
                    S2.append([j, sq + (i-j)])
                else:
                    S2.append([j, (i-j)])
            else:
                S2.append([j, i-j]) len(S2) > 0 len(S2) len S2 0 if (S2[-1][0] > j):
                    while (S2[-1][0] > j):
                        poped = S2.pop()
                        sq += poped[1]
                        if len(S2) == 0:
                            break
                    S2.append([j, sq + (i-j)])
                else:
                    S2.append([j, (i-j)])
             S2[-1][0] > j S2[-1][0] [-1] S2 -1 0 j while (S2[-1][0] > j):
                        poped = S2.pop()
                        sq += poped[1]
                        if len(S2) == 0:
                            break
                     S2[-1][0] > j S2[-1][0] [-1] S2 -1 0 j poped = S2.pop() poped S2.pop() S2.pop S2 pop sq += poped[1] sq poped[1] poped 1 if len(S2) == 0:
                            break
                     len(S2) == 0 len(S2) len S2 0 break S2.append([j, sq + (i-j)]) S2.append S2 append [j, sq + (i-j)] j sq + (i-j) sq i-j i j S2.append([j, (i-j)]) S2.append S2 append [j, (i-j)] j i-j i j S2.append([j, i-j]) S2.append S2 append [j, i-j] j i-j i j print(total_square) print total_square print(len(S2), end = "") print len(S2) len S2 end = "" end "" for data in S2:
    print(' ' + str(data[1]), end = "") data S2 print(' ' + str(data[1]), end = "") print ' ' + str(data[1]) ' ' str(data[1]) str data[1] data 1 end = "" end "" print() print poped = S2.pop() S2.pop() poped S1 = [] [] S1 j = 0 0 j sq = 0 0 sq total_square = 0 0 total_square j = S1.pop() S1.pop() j total_square += (i - j) i - j total_square input = list(input()) list(input()) input sq += poped[1] poped[1] sq S2 = [] [] S2
# coding=utf-8

S1 = []
S2 = []
total_square = 0
j = 0

input = list(input())

for i, val in enumerate(input):
    sq = 0
    if val == '\\':
        S1.append(i)
    elif val == '/':
        if len(S1) > 0:
            j = S1.pop()
            total_square += (i - j)
            if len(S2) > 0:
                if (S2[-1][0] > j):
                    while (S2[-1][0] > j):
                        poped = S2.pop()
                        sq += poped[1]
                        if len(S2) == 0:
                            break
                    S2.append([j, sq + (i-j)])
                else:
                    S2.append([j, (i-j)])
            else:
                S2.append([j, i-j])

print(total_square)
print(len(S2), end = "")
for data in S2:
    print(' ' + str(data[1]), end = "")
print()