li = []
for i, s in enumerate(input()):
    if s == "\\":
        li.append([i, 0])
    elif s == "/":
        if li:
            if li[-1][1] == 0:
                li[-1][1] = i - li[-1][0]
            else:
                for j in range(len(li) - 1, -1, -1):
                    if li[j][1] == 0:
                        li = li[:j] + [[li[j][0], sum(tuple(zip(*li[j + 1:]))[1]) + i - li[j][0]]]
                        break
ans = []
for a in li:
    if a[1] != 0:
        ans.append(a[1])
print(sum(ans))
print(len(ans), *ans)
 li = [] li [] for i, s in enumerate(input()):
    if s == "\\":
        li.append([i, 0])
    elif s == "/":
        if li:
            if li[-1][1] == 0:
                li[-1][1] = i - li[-1][0]
            else:
                for j in range(len(li) - 1, -1, -1):
                    if li[j][1] == 0:
                        li = li[:j] + [[li[j][0], sum(tuple(zip(*li[j + 1:]))[1]) + i - li[j][0]]]
                        break i s enumerate(input()) enumerate input() input if s == "\\":
        li.append([i, 0])
    elif s == "/":
        if li:
            if li[-1][1] == 0:
                li[-1][1] = i - li[-1][0]
            else:
                for j in range(len(li) - 1, -1, -1):
                    if li[j][1] == 0:
                        li = li[:j] + [[li[j][0], sum(tuple(zip(*li[j + 1:]))[1]) + i - li[j][0]]]
                        break s == "\\" s "\\" li.append([i, 0]) li.append li append [i, 0] i 0 elif s == "/":
        if li:
            if li[-1][1] == 0:
                li[-1][1] = i - li[-1][0]
            else:
                for j in range(len(li) - 1, -1, -1):
                    if li[j][1] == 0:
                        li = li[:j] + [[li[j][0], sum(tuple(zip(*li[j + 1:]))[1]) + i - li[j][0]]]
                        break s == "/" s "/" if li:
            if li[-1][1] == 0:
                li[-1][1] = i - li[-1][0]
            else:
                for j in range(len(li) - 1, -1, -1):
                    if li[j][1] == 0:
                        li = li[:j] + [[li[j][0], sum(tuple(zip(*li[j + 1:]))[1]) + i - li[j][0]]]
                        break li if li[-1][1] == 0:
                li[-1][1] = i - li[-1][0]
            else:
                for j in range(len(li) - 1, -1, -1):
                    if li[j][1] == 0:
                        li = li[:j] + [[li[j][0], sum(tuple(zip(*li[j + 1:]))[1]) + i - li[j][0]]]
                        break li[-1][1] == 0 li[-1][1] [-1] li -1 1 0 li[-1][1] = i - li[-1][0] li[-1][1] [-1] li -1 1 i - li[-1][0] i li[-1][0] [-1] li -1 0 for j in range(len(li) - 1, -1, -1):
                    if li[j][1] == 0:
                        li = li[:j] + [[li[j][0], sum(tuple(zip(*li[j + 1:]))[1]) + i - li[j][0]]]
                        break j range(len(li) - 1, -1, -1) range len(li) - 1 len(li) len li 1 -1 -1 if li[j][1] == 0:
                        li = li[:j] + [[li[j][0], sum(tuple(zip(*li[j + 1:]))[1]) + i - li[j][0]]]
                        break li[j][1] == 0 li[j][1] [j] li j 1 0 li = li[:j] + [[li[j][0], sum(tuple(zip(*li[j + 1:]))[1]) + i - li[j][0]]] li li[:j] + [[li[j][0], sum(tuple(zip(*li[j + 1:]))[1]) + i - li[j][0]]] li[:j] li :j j [[li[j][0], sum(tuple(zip(*li[j + 1:]))[1]) + i - li[j][0]]] [li[j][0], sum(tuple(zip(*li[j + 1:]))[1]) + i - li[j][0]] li[j][0] [j] li j 0 sum(tuple(zip(*li[j + 1:]))[1]) + i - li[j][0] sum(tuple(zip(*li[j + 1:]))[1]) + i sum(tuple(zip(*li[j + 1:]))[1]) sum tuple(zip(*li[j + 1:]))[1] (zip(*li[j + 1:])) tuple zip(*li[j + 1:]) zip *li[j + 1:] li[j + 1:] li j + 1: j + 1 j 1 1 i li[j][0] [j] li j 0 break ans = [] ans [] for a in li:
    if a[1] != 0:
        ans.append(a[1]) a li if a[1] != 0:
        ans.append(a[1]) a[1] != 0 a[1] a 1 0 ans.append(a[1]) ans.append ans append a[1] a 1 print(sum(ans)) print sum(ans) sum ans print(len(ans), *ans) print len(ans) len ans *ans ans li = [] [] li li = li[:j] + [[li[j][0], sum(tuple(zip(*li[j + 1:]))[1]) + i - li[j][0]]] li[:j] + [[li[j][0], sum(tuple(zip(*li[j + 1:]))[1]) + i - li[j][0]]] li ans = [] [] ans
li = []
for i, s in enumerate(input()):
    if s == "\\":
        li.append([i, 0])
    elif s == "/":
        if li:
            if li[-1][1] == 0:
                li[-1][1] = i - li[-1][0]
            else:
                for j in range(len(li) - 1, -1, -1):
                    if li[j][1] == 0:
                        li = li[:j] + [[li[j][0], sum(tuple(zip(*li[j + 1:]))[1]) + i - li[j][0]]]
                        break
ans = []
for a in li:
    if a[1] != 0:
        ans.append(a[1])
print(sum(ans))
print(len(ans), *ans)

