areaStr = list(input())
N = len(areaStr)
tmpArea = []
totalArea = 0
eachArea = []
"""
for i in range(N):
    if areaStr[i] == "\\":
        tmpArea.append(i)
    elif areaStr[i] == "/":
        if len(tmpArea) != 0:
            totalArea += (i - tmpArea.pop())
    else:
        pass
    
"""


tmpArea = []
totalArea = 0
for i in range(N):
    if areaStr[i] == "\\":
        tmpArea.append(i)
    elif areaStr[i] == "/":
        if len(tmpArea) != 0:
            j = tmpArea.pop()
            
            totalArea += (i - j)
            a = i - j
            while(len(eachArea) > 0 and eachArea[len(eachArea) - 1][0] > j):
                a +=  eachArea.pop()[1]
               
            eachArea.append([j, a])
    else:
        pass
    

print(totalArea)
print(len(eachArea), end = "")
if len(eachArea) > 1:
    for i in range(len(eachArea)-1):
        print("", end = " ")
        print(eachArea[i][1], end = "")
if len(eachArea) >= 1:
    print("", end = " ")
    print(eachArea[len(eachArea)-1][1])
    
else:
    print("")





 areaStr = list(input()) areaStr list(input()) list input() input N = len(areaStr) N len(areaStr) len areaStr tmpArea = [] tmpArea [] totalArea = 0 totalArea 0 eachArea = [] eachArea [] """
for i in range(N):
    if areaStr[i] == "\\":
        tmpArea.append(i)
    elif areaStr[i] == "/":
        if len(tmpArea) != 0:
            totalArea += (i - tmpArea.pop())
    else:
        pass
    
""" tmpArea = [] tmpArea [] totalArea = 0 totalArea 0 for i in range(N):
    if areaStr[i] == "\\":
        tmpArea.append(i)
    elif areaStr[i] == "/":
        if len(tmpArea) != 0:
            j = tmpArea.pop()
            
            totalArea += (i - j)
            a = i - j
            while(len(eachArea) > 0 and eachArea[len(eachArea) - 1][0] > j):
                a +=  eachArea.pop()[1]
               
            eachArea.append([j, a])
    else:
        pass
     i range(N) range N if areaStr[i] == "\\":
        tmpArea.append(i)
    elif areaStr[i] == "/":
        if len(tmpArea) != 0:
            j = tmpArea.pop()
            
            totalArea += (i - j)
            a = i - j
            while(len(eachArea) > 0 and eachArea[len(eachArea) - 1][0] > j):
                a +=  eachArea.pop()[1]
               
            eachArea.append([j, a])
    else:
        pass
     areaStr[i] == "\\" areaStr[i] areaStr i "\\" tmpArea.append(i) tmpArea.append tmpArea append i elif areaStr[i] == "/":
        if len(tmpArea) != 0:
            j = tmpArea.pop()
            
            totalArea += (i - j)
            a = i - j
            while(len(eachArea) > 0 and eachArea[len(eachArea) - 1][0] > j):
                a +=  eachArea.pop()[1]
               
            eachArea.append([j, a])
     areaStr[i] == "/" areaStr[i] areaStr i "/" if len(tmpArea) != 0:
            j = tmpArea.pop()
            
            totalArea += (i - j)
            a = i - j
            while(len(eachArea) > 0 and eachArea[len(eachArea) - 1][0] > j):
                a +=  eachArea.pop()[1]
               
            eachArea.append([j, a])
     len(tmpArea) != 0 len(tmpArea) len tmpArea 0 j = tmpArea.pop() j tmpArea.pop() tmpArea.pop tmpArea pop totalArea += (i - j) totalArea i - j i j a = i - j a i - j i j while(len(eachArea) > 0 and eachArea[len(eachArea) - 1][0] > j):
                a +=  eachArea.pop()[1]
               
             len(eachArea) > 0 and eachArea[len(eachArea) - 1][0] > j len(eachArea) > 0 len(eachArea) len eachArea 0 eachArea[len(eachArea) - 1][0] > j eachArea[len(eachArea) - 1][0] [len(eachArea) - 1] eachArea len(eachArea) - 1 len(eachArea) len eachArea 1 0 j a +=  eachArea.pop()[1] a eachArea.pop()[1] eachArea.pop() eachArea.pop eachArea pop 1 eachArea.append([j, a]) eachArea.append eachArea append [j, a] j a print(totalArea) print totalArea print(len(eachArea), end = "") print len(eachArea) len eachArea end = "" end "" if len(eachArea) > 1:
    for i in range(len(eachArea)-1):
        print("", end = " ")
        print(eachArea[i][1], end = "") len(eachArea) > 1 len(eachArea) len eachArea 1 for i in range(len(eachArea)-1):
        print("", end = " ")
        print(eachArea[i][1], end = "") i range(len(eachArea)-1) range len(eachArea)-1 len(eachArea) len eachArea 1 print("", end = " ") print "" end = " " end " " print(eachArea[i][1], end = "") print eachArea[i][1] [i] eachArea i 1 end = "" end "" if len(eachArea) >= 1:
    print("", end = " ")
    print(eachArea[len(eachArea)-1][1])
    
else:
    print("") len(eachArea) >= 1 len(eachArea) len eachArea 1 print("", end = " ") print "" end = " " end " " print(eachArea[len(eachArea)-1][1]) print eachArea[len(eachArea)-1][1] [len(eachArea)-1] eachArea len(eachArea)-1 len(eachArea) len eachArea 1 1 print("") print "" areaStr = list(input()) list(input()) areaStr a = i - j i - j a eachArea = [] [] eachArea totalArea = 0 0 totalArea totalArea += (i - j) i - j totalArea tmpArea = [] [] tmpArea N = len(areaStr) len(areaStr) N tmpArea = [] [] tmpArea a +=  eachArea.pop()[1] eachArea.pop()[1] a totalArea = 0 0 totalArea j = tmpArea.pop() tmpArea.pop() j
areaStr = list(input())
N = len(areaStr)
tmpArea = []
totalArea = 0
eachArea = []
"""
for i in range(N):
    if areaStr[i] == "\\":
        tmpArea.append(i)
    elif areaStr[i] == "/":
        if len(tmpArea) != 0:
            totalArea += (i - tmpArea.pop())
    else:
        pass
    
"""


tmpArea = []
totalArea = 0
for i in range(N):
    if areaStr[i] == "\\":
        tmpArea.append(i)
    elif areaStr[i] == "/":
        if len(tmpArea) != 0:
            j = tmpArea.pop()
            
            totalArea += (i - j)
            a = i - j
            while(len(eachArea) > 0 and eachArea[len(eachArea) - 1][0] > j):
                a +=  eachArea.pop()[1]
               
            eachArea.append([j, a])
    else:
        pass
    

print(totalArea)
print(len(eachArea), end = "")
if len(eachArea) > 1:
    for i in range(len(eachArea)-1):
        print("", end = " ")
        print(eachArea[i][1], end = "")
if len(eachArea) >= 1:
    print("", end = " ")
    print(eachArea[len(eachArea)-1][1])
    
else:
    print("")






