s=input()
slash=[]
area=0

slash_2=[]
area_2=[]

for i in range(len(s)):
    if s[i]=="\\":
        slash.append(i)
    elif s[i]=="/":
        try: 
            j=slash.pop()
            area=area+i-j
            a=i-j
            while len(area_2) > 0 and slash_2[len(slash_2)-1] >j:
                a=a+area_2[len(slash_2)-1]
                area_2.pop()
                slash_2.pop() 
            slash_2.append(j)     
            area_2.append(a)
        except: pass


if area==0:
    print(0)
    print(0)
else:
    print(area)
    print(str(len(area_2))+" "+" ".join(map(str, area_2))) s=input() s input() input slash=[] slash [] area=0 area 0 slash_2=[] slash_2 [] area_2=[] area_2 [] for i in range(len(s)):
    if s[i]=="\\":
        slash.append(i)
    elif s[i]=="/":
        try: 
            j=slash.pop()
            area=area+i-j
            a=i-j
            while len(area_2) > 0 and slash_2[len(slash_2)-1] >j:
                a=a+area_2[len(slash_2)-1]
                area_2.pop()
                slash_2.pop() 
            slash_2.append(j)     
            area_2.append(a)
        except: pass i range(len(s)) range len(s) len s if s[i]=="\\":
        slash.append(i)
    elif s[i]=="/":
        try: 
            j=slash.pop()
            area=area+i-j
            a=i-j
            while len(area_2) > 0 and slash_2[len(slash_2)-1] >j:
                a=a+area_2[len(slash_2)-1]
                area_2.pop()
                slash_2.pop() 
            slash_2.append(j)     
            area_2.append(a)
        except: pass s[i]=="\\" s[i] s i "\\" slash.append(i) slash.append slash append i elif s[i]=="/":
        try: 
            j=slash.pop()
            area=area+i-j
            a=i-j
            while len(area_2) > 0 and slash_2[len(slash_2)-1] >j:
                a=a+area_2[len(slash_2)-1]
                area_2.pop()
                slash_2.pop() 
            slash_2.append(j)     
            area_2.append(a)
        except: pass s[i]=="/" s[i] s i "/" try: 
            j=slash.pop()
            area=area+i-j
            a=i-j
            while len(area_2) > 0 and slash_2[len(slash_2)-1] >j:
                a=a+area_2[len(slash_2)-1]
                area_2.pop()
                slash_2.pop() 
            slash_2.append(j)     
            area_2.append(a)
        except: pass exce j=slash.pop() j slash.pop() slash.pop slash pop area=area+i-j area area+i-j area+i area i j a=i-j a i-j i j while len(area_2) > 0 and slash_2[len(slash_2)-1] >j:
                a=a+area_2[len(slash_2)-1]
                area_2.pop()
                slash_2.pop() 
             len(area_2) > 0 and slash_2[len(slash_2)-1] >j len(area_2) > 0 len(area_2) len area_2 0 slash_2[len(slash_2)-1] >j slash_2[len(slash_2)-1] slash_2 len(slash_2)-1 len(slash_2) len slash_2 1 j a=a+area_2[len(slash_2)-1] a a+area_2[len(slash_2)-1] a area_2[len(slash_2)-1] area_2 len(slash_2)-1 len(slash_2) len slash_2 1 area_2.pop() area_2.pop area_2 pop slash_2.pop() slash_2.pop slash_2 pop slash_2.append(j) slash_2.append slash_2 append j area_2.append(a) area_2.append area_2 append a if area==0:
    print(0)
    print(0)
else:
    print(area)
    print(str(len(area_2))+" "+" ".join(map(str, area_2))) area==0 area 0 print(0) print 0 print(0) print 0 print(area) print area print(str(len(area_2))+" "+" ".join(map(str, area_2))) print str(len(area_2))+" "+" ".join(map(str, area_2)) str(len(area_2))+" " str(len(area_2)) str len(area_2) len area_2 " " " ".join(map(str, area_2)) " ".join " " join map(str, area_2) map str area_2 a=a+area_2[len(slash_2)-1] a+area_2[len(slash_2)-1] a a=i-j i-j a area=0 0 area slash_2=[] [] slash_2 j=slash.pop() slash.pop() j s=input() input() s area_2=[] [] area_2 slash=[] [] slash area=area+i-j area+i-j area
s=input()
slash=[]
area=0

slash_2=[]
area_2=[]

for i in range(len(s)):
    if s[i]=="\\":
        slash.append(i)
    elif s[i]=="/":
        try: 
            j=slash.pop()
            area=area+i-j
            a=i-j
            while len(area_2) > 0 and slash_2[len(slash_2)-1] >j:
                a=a+area_2[len(slash_2)-1]
                area_2.pop()
                slash_2.pop() 
            slash_2.append(j)     
            area_2.append(a)
        except: pass


if area==0:
    print(0)
    print(0)
else:
    print(area)
    print(str(len(area_2))+" "+" ".join(map(str, area_2)))
