s = input()
n = len(s)
St = []
St2 = []
h = 0
area = 0

for i in range(n):
    if s[i] == "\\":
        St.append(i)
        h -= 1
    elif s[i] == "/":
        h += 1
        if St:
            left = St.pop()
            area += i - left
            
            area2 = 0
            while St2:
                left2 = St2.pop()
                j = left2[0]
                if left < left2[0]:
                    area_add = left2[1]
                    area2 += area_add
                else:
                    St2.append(left2)
                    break
            St2.append([left, area2 + i-left])


print(area)
ans = [t[1] for t in St2]
if St2:
    print(len(St2), end = " ")
    print(*ans)

else:
    print(0)
 s = input() s input() input n = len(s) n len(s) len s St = [] St [] St2 = [] St2 [] h = 0 h 0 area = 0 area 0 for i in range(n):
    if s[i] == "\\":
        St.append(i)
        h -= 1
    elif s[i] == "/":
        h += 1
        if St:
            left = St.pop()
            area += i - left
            
            area2 = 0
            while St2:
                left2 = St2.pop()
                j = left2[0]
                if left < left2[0]:
                    area_add = left2[1]
                    area2 += area_add
                else:
                    St2.append(left2)
                    break
            St2.append([left, area2 + i-left]) i range(n) range n if s[i] == "\\":
        St.append(i)
        h -= 1
    elif s[i] == "/":
        h += 1
        if St:
            left = St.pop()
            area += i - left
            
            area2 = 0
            while St2:
                left2 = St2.pop()
                j = left2[0]
                if left < left2[0]:
                    area_add = left2[1]
                    area2 += area_add
                else:
                    St2.append(left2)
                    break
            St2.append([left, area2 + i-left]) s[i] == "\\" s[i] s i "\\" St.append(i) St.append St append i h -= 1 h 1 elif s[i] == "/":
        h += 1
        if St:
            left = St.pop()
            area += i - left
            
            area2 = 0
            while St2:
                left2 = St2.pop()
                j = left2[0]
                if left < left2[0]:
                    area_add = left2[1]
                    area2 += area_add
                else:
                    St2.append(left2)
                    break
            St2.append([left, area2 + i-left]) s[i] == "/" s[i] s i "/" h += 1 h 1 if St:
            left = St.pop()
            area += i - left
            
            area2 = 0
            while St2:
                left2 = St2.pop()
                j = left2[0]
                if left < left2[0]:
                    area_add = left2[1]
                    area2 += area_add
                else:
                    St2.append(left2)
                    break
            St2.append([left, area2 + i-left]) St left = St.pop() left St.pop() St.pop St pop area += i - left area i - left i left area2 = 0 area2 0 while St2:
                left2 = St2.pop()
                j = left2[0]
                if left < left2[0]:
                    area_add = left2[1]
                    area2 += area_add
                else:
                    St2.append(left2)
                    break
             St2 left2 = St2.pop() left2 St2.pop() St2.pop St2 pop j = left2[0] j left2[0] left2 0 if left < left2[0]:
                    area_add = left2[1]
                    area2 += area_add
                else:
                    St2.append(left2)
                    break
             left < left2[0] left left2[0] left2 0 area_add = left2[1] area_add left2[1] left2 1 area2 += area_add area2 area_add St2.append(left2) St2.append St2 append left2 break St2.append([left, area2 + i-left]) St2.append St2 append [left, area2 + i-left] left area2 + i-left area2 + i area2 i left print(area) print area t[1] for t in St2 for t in St2 t St2 for t in St2 t[1] t 1 ans = [t[1] for t in St2] ans [t[1] for t in St2] if St2:
    print(len(St2), end = " ")
    print(*ans)

else:
    print(0) St2 print(len(St2), end = " ") print len(St2) len St2 end = " " end " " print(*ans) print *ans ans print(0) print 0 h = 0 0 h h -= 1 1 h area += i - left i - left area h += 1 1 h left2 = St2.pop() St2.pop() left2 s = input() input() s area2 += area_add area_add area2 area = 0 0 area area_add = left2[1] left2[1] area_add left = St.pop() St.pop() left St = [] [] St j = left2[0] left2[0] j n = len(s) len(s) n ans = [t[1] for t in St2] [t[1] for t in St2] ans St2 = [] [] St2 area2 = 0 0 area2
s = input()
n = len(s)
St = []
St2 = []
h = 0
area = 0

for i in range(n):
    if s[i] == "\\":
        St.append(i)
        h -= 1
    elif s[i] == "/":
        h += 1
        if St:
            left = St.pop()
            area += i - left
            
            area2 = 0
            while St2:
                left2 = St2.pop()
                j = left2[0]
                if left < left2[0]:
                    area_add = left2[1]
                    area2 += area_add
                else:
                    St2.append(left2)
                    break
            St2.append([left, area2 + i-left])


print(area)
ans = [t[1] for t in St2]
if St2:
    print(len(St2), end = " ")
    print(*ans)

else:
    print(0)

