Your task is to simulate a flood damage.  For a given cross-section diagram, reports areas of flooded sections.         Assume that rain is falling endlessly in the region and the water overflowing from the region is falling in the sea at the both sides. For example, for the above cross-section diagram, the rain will create floods which have areas of 4, 2, 1, 19 and 9 respectively.

t=input()
pair=[]
pond=[]
sum=0

for i in range(len(t)):
    if t[i]=="\\" :
        pair.append(i)
    elif t[i]=="/" and len(pair)!=0:
        p1=pair.pop()
        pond.append(i-p1)
        sum+=i-p1

print(sum)
print(len(pond),*pond)





t=input()
s1=[]
s2=[]
pond=[]
totalsum=0

for i in range(len(t)):
    if t[i]=="\\" :
        s1.append(i)
    elif t[i]=="/" and len(s1)!=0:
        p1=s1.pop()
        sum=i-p1
        totalsum+=sum
        while len(s2)>0:
            if s2[-1]>p1:
                s2.pop()
                sum+=pond.pop()
            else:
                break
        pond.append(sum)
        s2.append(i)


print(totalsum)
print(len(pond),*pond)


