l={}
s=[]
h=[0]
n=d=m=0
for c in raw_input():
    if c=="\\":
        l[d]=n
        d-=1
    elif c=="/":
        d+=1
        if d in l:
            while len(s) and s[-1][1]>l[d]: s.pop()
            s.append([l[d],n])
    n+=1
    h.append(d)

a=[sum([h[i]-k for k in h[i:j+1]]) for i,j in s]
print sum(a)
print " ".join(map(str,[len(a)]+a)) l={} l {} s=[] s [] h=[0] h [0] 0 n=d=m=0 n 0 =d=m=0 d 0 m for c in raw_input():
    if c=="\\":
        l[d]=n
        d-=1
    elif c=="/":
        d+=1
        if d in l:
            while len(s) and s[-1][1]>l[d]: s.pop()
            s.append([l[d],n])
    n+=1
    h.append(d) c raw_input() raw_input if c=="\\":
        l[d]=n
        d-=1
    elif c=="/":
        d+=1
        if d in l:
            while len(s) and s[-1][1]>l[d]: s.pop()
            s.append([l[d],n])
     c=="\\" c "\\" l[d]=n l[d] l d n d-=1 d 1 elif c=="/":
        d+=1
        if d in l:
            while len(s) and s[-1][1]>l[d]: s.pop()
            s.append([l[d],n])
     c=="/" c "/" d+=1 d 1 if d in l:
            while len(s) and s[-1][1]>l[d]: s.pop()
            s.append([l[d],n])
     d in l d l while len(s) and s[-1][1]>l[d]: s.pop()
             len(s) and s[-1][1]>l[d] len(s) len s s[-1][1]>l[d] s[-1][1] [-1] s -1 1 l[d] l d s.append([l[d],n]) s.append s append [l[d],n] l[d] l d n n+=1 n 1 h.append(d) h.append h append d sum([h[i]-k for k in h[i:j+1]]) for i,j in s for i,j in s i j s for i,j in s sum([h[i]-k for k in h[i:j+1]]) sum [h[i]-k for k in h[i:j+1]] a=[sum([h[i]-k for k in h[i:j+1]]) for i,j in s] a [sum([h[i]-k for k in h[i:j+1]]) for i,j in s] print sum(a) sum a print " ".join(map(str,[len(a)]+a)) " ".join " " join map(str,[len(a)]+a) map str [len(a)]+a [len(a)] len(a) len a a l={} {} l a=[sum([h[i]-k for k in h[i:j+1]]) for i,j in s] [sum([h[i]-k for k in h[i:j+1]]) for i,j in s] a s=[] [] s d-=1 1 d d=m=0 0 d h=[0] [0] h n+=1 1 n n=d=m=0 0 n m=0 0 m d+=1 1 d
l={}
s=[]
h=[0]
n=d=m=0
for c in raw_input():
    if c=="\\":
        l[d]=n
        d-=1
    elif c=="/":
        d+=1
        if d in l:
            while len(s) and s[-1][1]>l[d]: s.pop()
            s.append([l[d],n])
    n+=1
    h.append(d)

a=[sum([h[i]-k for k in h[i:j+1]]) for i,j in s]
print sum(a)
print " ".join(map(str,[len(a)]+a))