# -*- coding: utf-8 -*-

import sys

I = list(input())

A = 0
L = []
LH = []
k = 0
while len(I) > 0:
    i = I.pop()

    if i == '/':
        d = 1
        a = 0.5
        tmp_I = ['/']

        # print("[{}] d: {}".format(i, d))

        while len(I) > 0:
            i = I.pop()

            tmp_I.append(i)

            if i == '/':
                d += 1
                a += 0.5 + d - 1
            elif i == '\\':
                a += 0.5 + d - 1
                d -= 1
                if d == 0:
                    A += a
                    L.append(a)
                    k += 1
                    tmp_I = []
                    break
            elif i == '_':
                a += d

            # print("[{}] d: {}".format(i, d))

        # print("{}".format(tmp_I))

        if len(tmp_I) > 0:
            d = a = 0
            while len(tmp_I) > 0:
                i = tmp_I.pop()
                # print("{}".format(i))
                if i == '\\':
                    d += 1
                    a += 0.5 + d - 1
                elif i == '_':
                    a += d
                elif i == '/' and d > 0:
                    a += 0.5 + d - 1
                    d -= 1

                    if d == 0:
                        # print("Add tmp: {} ({})".format(a, tmp_I))
                        A += a
                        LH.append(a)
                        k += 1
                        a = 0

print(int(A))
sys.stdout.write(str(k))
for l in LH:
    sys.stdout.write(" {}".format(int(l)))
while len(L) > 0:
    sys.stdout.write(" {}".format(int(L.pop())))
sys.stdout.write('\n') import sys sys I = list(input()) I list(input()) list input() input A = 0 A 0 L = [] L [] LH = [] LH [] k = 0 k 0 while len(I) > 0:
    i = I.pop()

    if i == '/':
        d = 1
        a = 0.5
        tmp_I = ['/']

        # print("[{}] d: {}".format(i, d))

        while len(I) > 0:
            i = I.pop()

            tmp_I.append(i)

            if i == '/':
                d += 1
                a += 0.5 + d - 1
            elif i == '\\':
                a += 0.5 + d - 1
                d -= 1
                if d == 0:
                    A += a
                    L.append(a)
                    k += 1
                    tmp_I = []
                    break
            elif i == '_':
                a += d

            # print("[{}] d: {}".format(i, d))

        # print("{}".format(tmp_I))

        if len(tmp_I) > 0:
            d = a = 0
            while len(tmp_I) > 0:
                i = tmp_I.pop()
                # print("{}".format(i))
                if i == '\\':
                    d += 1
                    a += 0.5 + d - 1
                elif i == '_':
                    a += d
                elif i == '/' and d > 0:
                    a += 0.5 + d - 1
                    d -= 1

                    if d == 0:
                        # print("Add tmp: {} ({})".format(a, tmp_I))
                        A += a
                        LH.append(a)
                        k += 1
                        a = 0 len(I) > 0 len(I) len I 0 i = I.pop() i I.pop() I.pop I pop if i == '/':
        d = 1
        a = 0.5
        tmp_I = ['/']

        # print("[{}] d: {}".format(i, d))

        while len(I) > 0:
            i = I.pop()

            tmp_I.append(i)

            if i == '/':
                d += 1
                a += 0.5 + d - 1
            elif i == '\\':
                a += 0.5 + d - 1
                d -= 1
                if d == 0:
                    A += a
                    L.append(a)
                    k += 1
                    tmp_I = []
                    break
            elif i == '_':
                a += d

            # print("[{}] d: {}".format(i, d))

        # print("{}".format(tmp_I))

        if len(tmp_I) > 0:
            d = a = 0
            while len(tmp_I) > 0:
                i = tmp_I.pop()
                # print("{}".format(i))
                if i == '\\':
                    d += 1
                    a += 0.5 + d - 1
                elif i == '_':
                    a += d
                elif i == '/' and d > 0:
                    a += 0.5 + d - 1
                    d -= 1

                    if d == 0:
                        # print("Add tmp: {} ({})".format(a, tmp_I))
                        A += a
                        LH.append(a)
                        k += 1
                        a = 0 i == '/' i '/' d = 1 d 1 a = 0.5 a 0.5 tmp_I = ['/'] tmp_I ['/'] '/' while len(I) > 0:
            i = I.pop()

            tmp_I.append(i)

            if i == '/':
                d += 1
                a += 0.5 + d - 1
            elif i == '\\':
                a += 0.5 + d - 1
                d -= 1
                if d == 0:
                    A += a
                    L.append(a)
                    k += 1
                    tmp_I = []
                    break
            elif i == '_':
                a += d

            # print("[{}] d: {}".format(i, d))

        # print("{}".format(tmp_I))

         len(I) > 0 len(I) len I 0 i = I.pop() i I.pop() I.pop I pop tmp_I.append(i) tmp_I.append tmp_I append i if i == '/':
                d += 1
                a += 0.5 + d - 1
            elif i == '\\':
                a += 0.5 + d - 1
                d -= 1
                if d == 0:
                    A += a
                    L.append(a)
                    k += 1
                    tmp_I = []
                    break
            elif i == '_':
                a += d

            # print("[{}] d: {}".format(i, d))

        # print("{}".format(tmp_I))

         i == '/' i '/' d += 1 d 1 a += 0.5 + d - 1 a 0.5 + d - 1 0.5 + d 0.5 d 1 elif i == '\\':
                a += 0.5 + d - 1
                d -= 1
                if d == 0:
                    A += a
                    L.append(a)
                    k += 1
                    tmp_I = []
                    break
             i == '\\' i '\\' a += 0.5 + d - 1 a 0.5 + d - 1 0.5 + d 0.5 d 1 d -= 1 d 1 if d == 0:
                    A += a
                    L.append(a)
                    k += 1
                    tmp_I = []
                    break
             d == 0 d 0 A += a A a L.append(a) L.append L append a k += 1 k 1 tmp_I = [] tmp_I [] break elif i == '_':
                a += d

            # print("[{}] d: {}".format(i, d))

        # print("{}".format(tmp_I))

         i == '_' i '_' a += d a d if len(tmp_I) > 0:
            d = a = 0
            while len(tmp_I) > 0:
                i = tmp_I.pop()
                # print("{}".format(i))
                if i == '\\':
                    d += 1
                    a += 0.5 + d - 1
                elif i == '_':
                    a += d
                elif i == '/' and d > 0:
                    a += 0.5 + d - 1
                    d -= 1

                    if d == 0:
                        # print("Add tmp: {} ({})".format(a, tmp_I))
                        A += a
                        LH.append(a)
                        k += 1
                        a = 0 len(tmp_I) > 0 len(tmp_I) len tmp_I 0 d = a = 0 d 0 = a = 0 a 0 while len(tmp_I) > 0:
                i = tmp_I.pop()
                # print("{}".format(i))
                if i == '\\':
                    d += 1
                    a += 0.5 + d - 1
                elif i == '_':
                    a += d
                elif i == '/' and d > 0:
                    a += 0.5 + d - 1
                    d -= 1

                    if d == 0:
                        # print("Add tmp: {} ({})".format(a, tmp_I))
                        A += a
                        LH.append(a)
                        k += 1
                        a = 0 len(tmp_I) > 0 len(tmp_I) len tmp_I 0 i = tmp_I.pop() i tmp_I.pop() tmp_I.pop tmp_I pop if i == '\\':
                    d += 1
                    a += 0.5 + d - 1
                elif i == '_':
                    a += d
                elif i == '/' and d > 0:
                    a += 0.5 + d - 1
                    d -= 1

                    if d == 0:
                        # print("Add tmp: {} ({})".format(a, tmp_I))
                        A += a
                        LH.append(a)
                        k += 1
                        a = 0 i == '\\' i '\\' d += 1 d 1 a += 0.5 + d - 1 a 0.5 + d - 1 0.5 + d 0.5 d 1 elif i == '_':
                    a += d
                 i == '_' i '_' a += d a d elif i == '/' and d > 0:
                    a += 0.5 + d - 1
                    d -= 1

                    if d == 0:
                        # print("Add tmp: {} ({})".format(a, tmp_I))
                        A += a
                        LH.append(a)
                        k += 1
                        a = 0 i == '/' and d > 0 i == '/' i '/' d > 0 d 0 a += 0.5 + d - 1 a 0.5 + d - 1 0.5 + d 0.5 d 1 d -= 1 d 1 if d == 0:
                        # print("Add tmp: {} ({})".format(a, tmp_I))
                        A += a
                        LH.append(a)
                        k += 1
                        a = 0 d == 0 d 0 A += a A a LH.append(a) LH.append LH append a k += 1 k 1 a = 0 a 0 print(int(A)) print int(A) int A sys.stdout.write(str(k)) sys.stdout.write sys.stdout sys stdout write str(k) str k for l in LH:
    sys.stdout.write(" {}".format(int(l))) l LH sys.stdout.write(" {}".format(int(l))) sys.stdout.write sys.stdout sys stdout write " {}".format(int(l)) " {}".format " {}" format int(l) int l while len(L) > 0:
    sys.stdout.write(" {}".format(int(L.pop()))) len(L) > 0 len(L) len L 0 sys.stdout.write(" {}".format(int(L.pop()))) sys.stdout.write sys.stdout sys stdout write " {}".format(int(L.pop())) " {}".format " {}" format int(L.pop()) int L.pop() L.pop L pop sys.stdout.write('\n') sys.stdout.write sys.stdout sys stdout write '\n' a += 0.5 + d - 1 0.5 + d - 1 a I = list(input()) list(input()) I tmp_I = ['/'] ['/'] tmp_I L = [] [] L LH = [] [] LH d -= 1 1 d A += a a A k += 1 1 k d += 1 1 d a += 0.5 + d - 1 0.5 + d - 1 a A += a a A d = a = 0 0 d a = 0 0 a k += 1 1 k tmp_I = [] [] tmp_I a += 0.5 + d - 1 0.5 + d - 1 a k = 0 0 k i = tmp_I.pop() tmp_I.pop() i i = I.pop() I.pop() i d -= 1 1 d a += 0.5 + d - 1 0.5 + d - 1 a a += d d a A = 0 0 A a = 0.5 0.5 a a += d d a i = I.pop() I.pop() i a = 0 0 a d = 1 1 d d += 1 1 d
# -*- coding: utf-8 -*-

import sys

I = list(input())

A = 0
L = []
LH = []
k = 0
while len(I) > 0:
    i = I.pop()

    if i == '/':
        d = 1
        a = 0.5
        tmp_I = ['/']

        # print("[{}] d: {}".format(i, d))

        while len(I) > 0:
            i = I.pop()

            tmp_I.append(i)

            if i == '/':
                d += 1
                a += 0.5 + d - 1
            elif i == '\\':
                a += 0.5 + d - 1
                d -= 1
                if d == 0:
                    A += a
                    L.append(a)
                    k += 1
                    tmp_I = []
                    break
            elif i == '_':
                a += d

            # print("[{}] d: {}".format(i, d))

        # print("{}".format(tmp_I))

        if len(tmp_I) > 0:
            d = a = 0
            while len(tmp_I) > 0:
                i = tmp_I.pop()
                # print("{}".format(i))
                if i == '\\':
                    d += 1
                    a += 0.5 + d - 1
                elif i == '_':
                    a += d
                elif i == '/' and d > 0:
                    a += 0.5 + d - 1
                    d -= 1

                    if d == 0:
                        # print("Add tmp: {} ({})".format(a, tmp_I))
                        A += a
                        LH.append(a)
                        k += 1
                        a = 0

print(int(A))
sys.stdout.write(str(k))
for l in LH:
    sys.stdout.write(" {}".format(int(l)))
while len(L) > 0:
    sys.stdout.write(" {}".format(int(L.pop())))
sys.stdout.write('\n')