ary = list(input())
s1 = []
s = 0

s2 = []

cnt = 0
for _ in ary:

    if _ == '\\':
        s1.append(cnt)
        cnt += 1

    elif _ == '/':
        if s1:
            old_cnt = s1.pop()
            area = cnt - old_cnt
            s += area

            while s2:
                if old_cnt < s2[-1][0]:
                    area += s2.pop()[1]
                else:
                    break

            s2.append((old_cnt, area))

        cnt += 1

    else:
        cnt += 1

print(s)
print(len(s2), *[_[1] for _ in s2]) ary = list(input()) ary list(input()) list input() input s1 = [] s1 [] s = 0 s 0 s2 = [] s2 [] cnt = 0 cnt 0 for _ in ary:

    if _ == '\\':
        s1.append(cnt)
        cnt += 1

    elif _ == '/':
        if s1:
            old_cnt = s1.pop()
            area = cnt - old_cnt
            s += area

            while s2:
                if old_cnt < s2[-1][0]:
                    area += s2.pop()[1]
                else:
                    break

            s2.append((old_cnt, area))

        cnt += 1

    else:
        cnt += 1 _ ary if _ == '\\':
        s1.append(cnt)
        cnt += 1

    elif _ == '/':
        if s1:
            old_cnt = s1.pop()
            area = cnt - old_cnt
            s += area

            while s2:
                if old_cnt < s2[-1][0]:
                    area += s2.pop()[1]
                else:
                    break

            s2.append((old_cnt, area))

        cnt += 1

    else:
        cnt += 1 _ == '\\' _ '\\' s1.append(cnt) s1.append s1 append cnt cnt += 1 cnt 1 elif _ == '/':
        if s1:
            old_cnt = s1.pop()
            area = cnt - old_cnt
            s += area

            while s2:
                if old_cnt < s2[-1][0]:
                    area += s2.pop()[1]
                else:
                    break

            s2.append((old_cnt, area))

        cnt += 1

     _ == '/' _ '/' if s1:
            old_cnt = s1.pop()
            area = cnt - old_cnt
            s += area

            while s2:
                if old_cnt < s2[-1][0]:
                    area += s2.pop()[1]
                else:
                    break

            s2.append((old_cnt, area))

         s1 old_cnt = s1.pop() old_cnt s1.pop() s1.pop s1 pop area = cnt - old_cnt area cnt - old_cnt cnt old_cnt s += area s area while s2:
                if old_cnt < s2[-1][0]:
                    area += s2.pop()[1]
                else:
                    break

             s2 if old_cnt < s2[-1][0]:
                    area += s2.pop()[1]
                else:
                    break

             old_cnt < s2[-1][0] old_cnt s2[-1][0] [-1] s2 -1 0 area += s2.pop()[1] area s2.pop()[1] s2.pop() s2.pop s2 pop 1 break s2.append((old_cnt, area)) s2.append s2 append (old_cnt, area) old_cnt area cnt += 1 cnt 1 cnt += 1 cnt 1 print(s) print s _[1] for _ in s2 for _ in s2 _ s2 for _ in s2 _[1] _ 1 print(len(s2), *[_[1] for _ in s2]) print len(s2) len s2 *[_[1] for _ in s2] [_[1] for _ in s2] old_cnt = s1.pop() s1.pop() old_cnt cnt += 1 1 cnt cnt = 0 0 cnt area += s2.pop()[1] s2.pop()[1] area s = 0 0 s s2 = [] [] s2 ary = list(input()) list(input()) ary cnt += 1 1 cnt s1 = [] [] s1 area = cnt - old_cnt cnt - old_cnt area s += area area s cnt += 1 1 cnt
ary = list(input())
s1 = []
s = 0

s2 = []

cnt = 0
for _ in ary:

    if _ == '\\':
        s1.append(cnt)
        cnt += 1

    elif _ == '/':
        if s1:
            old_cnt = s1.pop()
            area = cnt - old_cnt
            s += area

            while s2:
                if old_cnt < s2[-1][0]:
                    area += s2.pop()[1]
                else:
                    break

            s2.append((old_cnt, area))

        cnt += 1

    else:
        cnt += 1

print(s)
print(len(s2), *[_[1] for _ in s2])
