ss = input()

S1 = []
S2 = []

a = 0
for ind, s in enumerate(ss):
    if '\\' == s:
        S1.append(ind)
    elif s == '/':
        if len(S1) == 0:
            continue
        i = S1.pop()
        a += ind - i
        t = 0
        while len(S2) > 0 and S2[-1][0] > i-1:
            v = S2.pop()
            t += v[1]
        S2.append((i, ind-i+t))

print(a)
if len(S2) == 0:
    print(0)
else:
    print(len(S2), ' '.join(map(lambda x: str(x[1]), S2))) ss = input() ss input() input S1 = [] S1 [] S2 = [] S2 [] a = 0 a 0 for ind, s in enumerate(ss):
    if '\\' == s:
        S1.append(ind)
    elif s == '/':
        if len(S1) == 0:
            continue
        i = S1.pop()
        a += ind - i
        t = 0
        while len(S2) > 0 and S2[-1][0] > i-1:
            v = S2.pop()
            t += v[1]
        S2.append((i, ind-i+t)) ind s enumerate(ss) enumerate ss if '\\' == s:
        S1.append(ind)
    elif s == '/':
        if len(S1) == 0:
            continue
        i = S1.pop()
        a += ind - i
        t = 0
        while len(S2) > 0 and S2[-1][0] > i-1:
            v = S2.pop()
            t += v[1]
        S2.append((i, ind-i+t)) '\\' == s '\\' s S1.append(ind) S1.append S1 append ind elif s == '/':
        if len(S1) == 0:
            continue
        i = S1.pop()
        a += ind - i
        t = 0
        while len(S2) > 0 and S2[-1][0] > i-1:
            v = S2.pop()
            t += v[1]
        S2.append((i, ind-i+t)) s == '/' s '/' if len(S1) == 0:
            continue
         len(S1) == 0 len(S1) len S1 0 continue i = S1.pop() i S1.pop() S1.pop S1 pop a += ind - i a ind - i ind i t = 0 t 0 while len(S2) > 0 and S2[-1][0] > i-1:
            v = S2.pop()
            t += v[1]
         len(S2) > 0 and S2[-1][0] > i-1 len(S2) > 0 len(S2) len S2 0 S2[-1][0] > i-1 S2[-1][0] [-1] S2 -1 0 i-1 i 1 v = S2.pop() v S2.pop() S2.pop S2 pop t += v[1] t v[1] v 1 S2.append((i, ind-i+t)) S2.append S2 append (i, ind-i+t) i ind-i+t ind-i ind i t print(a) print a if len(S2) == 0:
    print(0)
else:
    print(len(S2), ' '.join(map(lambda x: str(x[1]), S2))) len(S2) == 0 len(S2) len S2 0 print(0) print 0 print(len(S2), ' '.join(map(lambda x: str(x[1]), S2))) print len(S2) len S2 ' '.join(map(lambda x: str(x[1]), S2)) ' '.join ' ' join map(lambda x: str(x[1]), S2) map lambda x: str(x[1]) str(x[1]) str x[1] x 1 x S2 ss = input() input() ss S1 = [] [] S1 v = S2.pop() S2.pop() v t = 0 0 t a += ind - i ind - i a a = 0 0 a t += v[1] v[1] t S2 = [] [] S2 i = S1.pop() S1.pop() i
ss = input()

S1 = []
S2 = []

a = 0
for ind, s in enumerate(ss):
    if '\\' == s:
        S1.append(ind)
    elif s == '/':
        if len(S1) == 0:
            continue
        i = S1.pop()
        a += ind - i
        t = 0
        while len(S2) > 0 and S2[-1][0] > i-1:
            v = S2.pop()
            t += v[1]
        S2.append((i, ind-i+t))

print(a)
if len(S2) == 0:
    print(0)
else:
    print(len(S2), ' '.join(map(lambda x: str(x[1]), S2)))