n = input()

s1 = []
s2 = []

for i in range(len(n)):
    if n[i] == '\\':
        s1.append(i)
    elif n[i] == '/' and len(s1) > 0:
        a = s1.pop(-1)
        s2.append([a, i - a])

i = 0
while len(s2) > 1:
    if i == len(s2) - 1:
        break
    elif s2[i][0] > s2[i + 1][0]:
        s2[i + 1][1] += s2.pop(i)[1]
        i = 0
    else:
        i += 1

s = []
total = 0
for i in s2:
    s.append(str(int(i[1])))
    total += int(i[1])
print(total)
if len(s2) == 0:
    print('0')
else:
    print('{} {}'.format(len(s2), ' '.join(s))) n = input() n input() input s1 = [] s1 [] s2 = [] s2 [] for i in range(len(n)):
    if n[i] == '\\':
        s1.append(i)
    elif n[i] == '/' and len(s1) > 0:
        a = s1.pop(-1)
        s2.append([a, i - a]) i range(len(n)) range len(n) len n if n[i] == '\\':
        s1.append(i)
    elif n[i] == '/' and len(s1) > 0:
        a = s1.pop(-1)
        s2.append([a, i - a]) n[i] == '\\' n[i] n i '\\' s1.append(i) s1.append s1 append i elif n[i] == '/' and len(s1) > 0:
        a = s1.pop(-1)
        s2.append([a, i - a]) n[i] == '/' and len(s1) > 0 n[i] == '/' n[i] n i '/' len(s1) > 0 len(s1) len s1 0 a = s1.pop(-1) a s1.pop(-1) s1.pop s1 pop -1 s2.append([a, i - a]) s2.append s2 append [a, i - a] a i - a i a i = 0 i 0 while len(s2) > 1:
    if i == len(s2) - 1:
        break
    elif s2[i][0] > s2[i + 1][0]:
        s2[i + 1][1] += s2.pop(i)[1]
        i = 0
    else:
        i += 1 len(s2) > 1 len(s2) len s2 1 if i == len(s2) - 1:
        break
    elif s2[i][0] > s2[i + 1][0]:
        s2[i + 1][1] += s2.pop(i)[1]
        i = 0
    else:
        i += 1 i == len(s2) - 1 i len(s2) - 1 len(s2) len s2 1 break elif s2[i][0] > s2[i + 1][0]:
        s2[i + 1][1] += s2.pop(i)[1]
        i = 0
     s2[i][0] > s2[i + 1][0] s2[i][0] [i] s2 i 0 s2[i + 1][0] [i + 1] s2 i + 1 i 1 0 s2[i + 1][1] += s2.pop(i)[1] s2[i + 1][1] [i + 1] s2 i + 1 i 1 1 s2.pop(i)[1] s2.pop(i) s2.pop s2 pop i 1 i = 0 i 0 i += 1 i 1 s = [] s [] total = 0 total 0 for i in s2:
    s.append(str(int(i[1])))
    total += int(i[1]) i s2 s.append(str(int(i[1]))) s.append s append str(int(i[1])) str int(i[1]) int i[1] i 1 total += int(i[1]) total int(i[1]) int i[1] i 1 print(total) print total if len(s2) == 0:
    print('0')
else:
    print('{} {}'.format(len(s2), ' '.join(s))) len(s2) == 0 len(s2) len s2 0 print('0') print '0' print('{} {}'.format(len(s2), ' '.join(s))) print '{} {}'.format(len(s2), ' '.join(s)) '{} {}'.format '{} {}' format len(s2) len s2 ' '.join(s) ' '.join ' ' join s s = [] [] s total = 0 0 total s1 = [] [] s1 a = s1.pop(-1) s1.pop(-1) a i = 0 0 i i = 0 0 i total += int(i[1]) int(i[1]) total i += 1 1 i n = input() input() n s2 = [] [] s2
n = input()

s1 = []
s2 = []

for i in range(len(n)):
    if n[i] == '\\':
        s1.append(i)
    elif n[i] == '/' and len(s1) > 0:
        a = s1.pop(-1)
        s2.append([a, i - a])

i = 0
while len(s2) > 1:
    if i == len(s2) - 1:
        break
    elif s2[i][0] > s2[i + 1][0]:
        s2[i + 1][1] += s2.pop(i)[1]
        i = 0
    else:
        i += 1

s = []
total = 0
for i in s2:
    s.append(str(int(i[1])))
    total += int(i[1])
print(total)
if len(s2) == 0:
    print('0')
else:
    print('{} {}'.format(len(s2), ' '.join(s)))
