#input
A = list(input())
#print(A)
##    print(A[i],end = "")
#print(len(A))
sum = 0
#Stack
Stack1 = [] #各水たまりの面積
Stack2 = [] #
for i in range(len(A)):
    if A[i] == "\\":
        Stack1.append(i)
    elif A[i] == "/":
        if Stack1 != []:
            ip = Stack1.pop()
            tmp_sum = i-ip
            sum += i-ip

            xp, yp = ip,tmp_sum

            #-----------------------#
            if Stack2 == []:
                Stack2.append((i, tmp_sum))
            #-----------------------
            else:

                x, y = Stack2.pop()
                # x < ip(xp)
                while ( x- xp >= 0):
                    yp = y + yp
                    if Stack2 == []:
                        xp = x
                        Stack2.append((xp, yp))
                        break
                    else:
                        x, y = Stack2.pop()
                    #Stack2.append((xp, y + yp))
                else:
                    Stack2.append((x, y))
                    Stack2.append((xp, yp))

#print(Stack2)
print(sum)
if sum == 0:
    print(0)
else:
    print(len(Stack2), end=' ') #k
    for i in range(len(Stack2)):
        x, y = Stack2[i]
        if i < len(Stack2)-1:
            print(y, end=' ')
        else:
            print(y) A = list(input()) A list(input()) list input() input sum = 0 sum 0 Stack1 = [] Stack1 [] Stack2 = [] Stack2 [] for i in range(len(A)):
    if A[i] == "\\":
        Stack1.append(i)
    elif A[i] == "/":
        if Stack1 != []:
            ip = Stack1.pop()
            tmp_sum = i-ip
            sum += i-ip

            xp, yp = ip,tmp_sum

            #-----------------------#
            if Stack2 == []:
                Stack2.append((i, tmp_sum))
            #-----------------------
            else:

                x, y = Stack2.pop()
                # x < ip(xp)
                while ( x- xp >= 0):
                    yp = y + yp
                    if Stack2 == []:
                        xp = x
                        Stack2.append((xp, yp))
                        break
                    else:
                        x, y = Stack2.pop()
                    #Stack2.append((xp, y + yp))
                else:
                    Stack2.append((x, y))
                    Stack2.append((xp, yp))

#print(Stack2) i range(len(A)) range len(A) len A if A[i] == "\\":
        Stack1.append(i)
    elif A[i] == "/":
        if Stack1 != []:
            ip = Stack1.pop()
            tmp_sum = i-ip
            sum += i-ip

            xp, yp = ip,tmp_sum

            #-----------------------#
            if Stack2 == []:
                Stack2.append((i, tmp_sum))
            #-----------------------
            else:

                x, y = Stack2.pop()
                # x < ip(xp)
                while ( x- xp >= 0):
                    yp = y + yp
                    if Stack2 == []:
                        xp = x
                        Stack2.append((xp, yp))
                        break
                    else:
                        x, y = Stack2.pop()
                    #Stack2.append((xp, y + yp))
                else:
                    Stack2.append((x, y))
                    Stack2.append((xp, yp))

#print(Stack2) A[i] == "\\" A[i] A i "\\" Stack1.append(i) Stack1.append Stack1 append i elif A[i] == "/":
        if Stack1 != []:
            ip = Stack1.pop()
            tmp_sum = i-ip
            sum += i-ip

            xp, yp = ip,tmp_sum

            #-----------------------#
            if Stack2 == []:
                Stack2.append((i, tmp_sum))
            #-----------------------
            else:

                x, y = Stack2.pop()
                # x < ip(xp)
                while ( x- xp >= 0):
                    yp = y + yp
                    if Stack2 == []:
                        xp = x
                        Stack2.append((xp, yp))
                        break
                    else:
                        x, y = Stack2.pop()
                    #Stack2.append((xp, y + yp))
                else:
                    Stack2.append((x, y))
                    Stack2.append((xp, yp))

#print(Stack2) A[i] == "/" A[i] A i "/" if Stack1 != []:
            ip = Stack1.pop()
            tmp_sum = i-ip
            sum += i-ip

            xp, yp = ip,tmp_sum

            #-----------------------#
            if Stack2 == []:
                Stack2.append((i, tmp_sum))
            #-----------------------
            else:

                x, y = Stack2.pop()
                # x < ip(xp)
                while ( x- xp >= 0):
                    yp = y + yp
                    if Stack2 == []:
                        xp = x
                        Stack2.append((xp, yp))
                        break
                    else:
                        x, y = Stack2.pop()
                    #Stack2.append((xp, y + yp))
                else:
                    Stack2.append((x, y))
                    Stack2.append((xp, yp))

#print(Stack2) Stack1 != [] Stack1 [] ip = Stack1.pop() ip Stack1.pop() Stack1.pop Stack1 pop tmp_sum = i-ip tmp_sum i-ip i ip sum += i-ip sum i-ip i ip xp, yp = ip,tmp_sum xp ip yp tmp_sum if Stack2 == []:
                Stack2.append((i, tmp_sum))
            #-----------------------
            else:

                x, y = Stack2.pop()
                # x < ip(xp)
                while ( x- xp >= 0):
                    yp = y + yp
                    if Stack2 == []:
                        xp = x
                        Stack2.append((xp, yp))
                        break
                    else:
                        x, y = Stack2.pop()
                    #Stack2.append((xp, y + yp))
                else:
                    Stack2.append((x, y))
                    Stack2.append((xp, yp))

#print(Stack2) Stack2 == [] Stack2 [] Stack2.append((i, tmp_sum)) Stack2.append Stack2 append (i, tmp_sum) i tmp_sum x, y = Stack2.pop() x Stack2.pop() Stack2.pop Stack2 pop y while ( x- xp >= 0):
                    yp = y + yp
                    if Stack2 == []:
                        xp = x
                        Stack2.append((xp, yp))
                        break
                    else:
                        x, y = Stack2.pop()
                    #Stack2.append((xp, y + yp))
                else:
                    Stack2.append((x, y))
                    Stack2.append((xp, yp))

#print(Stack2) x- xp >= 0 x- xp x xp 0 yp = y + yp yp y + yp y yp if Stack2 == []:
                        xp = x
                        Stack2.append((xp, yp))
                        break
                    else:
                        x, y = Stack2.pop()
                    #Stack2.append((xp, y + yp))
                 Stack2 == [] Stack2 [] xp = x xp x Stack2.append((xp, yp)) Stack2.append Stack2 append (xp, yp) xp yp break x, y = Stack2.pop() x Stack2.pop() Stack2.pop Stack2 pop y Stack2.append((x, y)) Stack2.append Stack2 append (x, y) x y Stack2.append((xp, yp)) Stack2.append Stack2 append (xp, yp) xp yp print(sum) print sum if sum == 0:
    print(0)
else:
    print(len(Stack2), end=' ') #k
    for i in range(len(Stack2)):
        x, y = Stack2[i]
        if i < len(Stack2)-1:
            print(y, end=' ')
        else:
            print(y) sum == 0 sum 0 print(0) print 0 print(len(Stack2), end=' ') print len(Stack2) len Stack2 end=' ' end ' ' for i in range(len(Stack2)):
        x, y = Stack2[i]
        if i < len(Stack2)-1:
            print(y, end=' ')
        else:
            print(y) i range(len(Stack2)) range len(Stack2) len Stack2 x, y = Stack2[i] x Stack2[i] Stack2 i y if i < len(Stack2)-1:
            print(y, end=' ')
        else:
            print(y) i < len(Stack2)-1 i len(Stack2)-1 len(Stack2) len Stack2 1 print(y, end=' ') print y end=' ' end ' ' print(y) print y Stack2 = [] [] Stack2 xp, yp = ip,tmp_sum ip xp y = Stack2.pop() Stack2.pop() y xp = x x xp yp = y + yp y + yp yp x, y = Stack2.pop() Stack2.pop() x sum += i-ip i-ip sum Stack1 = [] [] Stack1 x, y = Stack2.pop() Stack2.pop() x y = Stack2.pop() Stack2.pop() y tmp_sum = i-ip i-ip tmp_sum yp = ip,tmp_sum tmp_sum yp sum = 0 0 sum x, y = Stack2[i] Stack2[i] x A = list(input()) list(input()) A ip = Stack1.pop() Stack1.pop() ip y = Stack2[i] Stack2[i] y
#input
A = list(input())
#print(A)
##    print(A[i],end = "")
#print(len(A))
sum = 0
#Stack
Stack1 = [] #各水たまりの面積
Stack2 = [] #
for i in range(len(A)):
    if A[i] == "\\":
        Stack1.append(i)
    elif A[i] == "/":
        if Stack1 != []:
            ip = Stack1.pop()
            tmp_sum = i-ip
            sum += i-ip

            xp, yp = ip,tmp_sum

            #-----------------------#
            if Stack2 == []:
                Stack2.append((i, tmp_sum))
            #-----------------------
            else:

                x, y = Stack2.pop()
                # x < ip(xp)
                while ( x- xp >= 0):
                    yp = y + yp
                    if Stack2 == []:
                        xp = x
                        Stack2.append((xp, yp))
                        break
                    else:
                        x, y = Stack2.pop()
                    #Stack2.append((xp, y + yp))
                else:
                    Stack2.append((x, y))
                    Stack2.append((xp, yp))

#print(Stack2)
print(sum)
if sum == 0:
    print(0)
else:
    print(len(Stack2), end=' ') #k
    for i in range(len(Stack2)):
        x, y = Stack2[i]
        if i < len(Stack2)-1:
            print(y, end=' ')
        else:
            print(y)
