s=input()
s1=[]
s2=[]
ans=[]
a=0
a1=0
for i in range(len(s)):
    if s[i]=="\\":
        s1.append(i)
    elif s[i]=="/" and s1:
        i2=s1[-1]
        a1=i-i2
        a+=a1
        while s2 and s2[-1][0]>i2:
            a1+=s2[-1][1]
            s2.pop()
        s2.append([i2,a1])
        s1.pop()


n=len(s2)
for j in range(n):
  ans.append(s2[j][1])
print(a)
print(n,*(ans)) s=input() s input() input s1=[] s1 [] s2=[] s2 [] ans=[] ans [] a=0 a 0 a1=0 a1 0 for i in range(len(s)):
    if s[i]=="\\":
        s1.append(i)
    elif s[i]=="/" and s1:
        i2=s1[-1]
        a1=i-i2
        a+=a1
        while s2 and s2[-1][0]>i2:
            a1+=s2[-1][1]
            s2.pop()
        s2.append([i2,a1])
        s1.pop() i range(len(s)) range len(s) len s if s[i]=="\\":
        s1.append(i)
    elif s[i]=="/" and s1:
        i2=s1[-1]
        a1=i-i2
        a+=a1
        while s2 and s2[-1][0]>i2:
            a1+=s2[-1][1]
            s2.pop()
        s2.append([i2,a1])
        s1.pop() s[i]=="\\" s[i] s i "\\" s1.append(i) s1.append s1 append i elif s[i]=="/" and s1:
        i2=s1[-1]
        a1=i-i2
        a+=a1
        while s2 and s2[-1][0]>i2:
            a1+=s2[-1][1]
            s2.pop()
        s2.append([i2,a1])
        s1.pop() s[i]=="/" and s1 s[i]=="/" s[i] s i "/" s1 i2=s1[-1] i2 s1[-1] s1 -1 a1=i-i2 a1 i-i2 i i2 a+=a1 a a1 while s2 and s2[-1][0]>i2:
            a1+=s2[-1][1]
            s2.pop()
         s2 and s2[-1][0]>i2 s2 s2[-1][0]>i2 s2[-1][0] [-1] s2 -1 0 i2 a1+=s2[-1][1] a1 s2[-1][1] [-1] s2 -1 1 s2.pop() s2.pop s2 pop s2.append([i2,a1]) s2.append s2 append [i2,a1] i2 a1 s1.pop() s1.pop s1 pop n=len(s2) n len(s2) len s2 for j in range(n):
  ans.append(s2[j][1]) j range(n) range n ans.append(s2[j][1]) ans.append ans append s2[j][1] [j] s2 j 1 print(a) print a print(n,*(ans)) print n *(ans) ans s2=[] [] s2 a+=a1 a1 a n=len(s2) len(s2) n s1=[] [] s1 a1=i-i2 i-i2 a1 a=0 0 a a1+=s2[-1][1] s2[-1][1] a1 s=input() input() s ans=[] [] ans a1=0 0 a1 i2=s1[-1] s1[-1] i2
s=input()
s1=[]
s2=[]
ans=[]
a=0
a1=0
for i in range(len(s)):
    if s[i]=="\\":
        s1.append(i)
    elif s[i]=="/" and s1:
        i2=s1[-1]
        a1=i-i2
        a+=a1
        while s2 and s2[-1][0]>i2:
            a1+=s2[-1][1]
            s2.pop()
        s2.append([i2,a1])
        s1.pop()


n=len(s2)
for j in range(n):
  ans.append(s2[j][1])
print(a)
print(n,*(ans))
