# coding:utf-8
danmen = input()
S1 = []
S2 = []
area = 0 # ?????????????°´???????????¢???

for i, line in enumerate(danmen):
    if line == '\\':
        S1.append(i)
    elif S1 and line == '/':
        loc = S1.pop()
        area += i-loc

        pond_sum = i-loc
        while S2 and S2[-1][0] > loc:
            pond_sum += S2[-1][1]
            S2.pop()

        S2.append([loc,pond_sum])


print(area)
print(len(S2),*(a for j,a in S2)) danmen = input() danmen input() input S1 = [] S1 [] S2 = [] S2 [] area = 0 area 0 for i, line in enumerate(danmen):
    if line == '\\':
        S1.append(i)
    elif S1 and line == '/':
        loc = S1.pop()
        area += i-loc

        pond_sum = i-loc
        while S2 and S2[-1][0] > loc:
            pond_sum += S2[-1][1]
            S2.pop()

        S2.append([loc,pond_sum]) i line enumerate(danmen) enumerate danmen if line == '\\':
        S1.append(i)
    elif S1 and line == '/':
        loc = S1.pop()
        area += i-loc

        pond_sum = i-loc
        while S2 and S2[-1][0] > loc:
            pond_sum += S2[-1][1]
            S2.pop()

        S2.append([loc,pond_sum]) line == '\\' line '\\' S1.append(i) S1.append S1 append i elif S1 and line == '/':
        loc = S1.pop()
        area += i-loc

        pond_sum = i-loc
        while S2 and S2[-1][0] > loc:
            pond_sum += S2[-1][1]
            S2.pop()

        S2.append([loc,pond_sum]) S1 and line == '/' S1 line == '/' line '/' loc = S1.pop() loc S1.pop() S1.pop S1 pop area += i-loc area i-loc i loc pond_sum = i-loc pond_sum i-loc i loc while S2 and S2[-1][0] > loc:
            pond_sum += S2[-1][1]
            S2.pop()

         S2 and S2[-1][0] > loc S2 S2[-1][0] > loc S2[-1][0] [-1] S2 -1 0 loc pond_sum += S2[-1][1] pond_sum S2[-1][1] [-1] S2 -1 1 S2.pop() S2.pop S2 pop S2.append([loc,pond_sum]) S2.append S2 append [loc,pond_sum] loc pond_sum print(area) print area a for j,a in S2 for j,a in S2 j a S2 for j,a in S2 a print(len(S2),*(a for j,a in S2)) print len(S2) len S2 *(a for j,a in S2) (a for j,a in S2) danmen = input() input() danmen area = 0 0 area pond_sum = i-loc i-loc pond_sum S2 = [] [] S2 area += i-loc i-loc area S1 = [] [] S1 pond_sum += S2[-1][1] S2[-1][1] pond_sum loc = S1.pop() S1.pop() loc
# coding:utf-8
danmen = input()
S1 = []
S2 = []
area = 0 # ?????????????°´???????????¢???

for i, line in enumerate(danmen):
    if line == '\\':
        S1.append(i)
    elif S1 and line == '/':
        loc = S1.pop()
        area += i-loc

        pond_sum = i-loc
        while S2 and S2[-1][0] > loc:
            pond_sum += S2[-1][1]
            S2.pop()

        S2.append([loc,pond_sum])


print(area)
print(len(S2),*(a for j,a in S2))