#https://onlinejudge.u-aizu.ac.jp/courses/lesson/1/ALDS1/3/ALDS1_3_D

s = str(input())
l = len(s)

h = [0]
for i in range(l):
    if s[i] == '\\':
        h.append(h[i]-1)
    elif s[i] == '/':
        h.append(h[i]+1)
    else:
        h.append(h[i])

a = []
m = -200000
n = 0
for i in range(l+1):
    if m == h[i] and i != 0:
        a.append([n,i,m])
        m = -200000
    if m < h[i] or i == 0:
        m = h[i]
        n = i
    if (m in h[i+1:]) == False:
        m = -200000

b = []
tmp = 0
for i in range(len(a)):
    for j in range(a[i][0],a[i][1]):
        tmp += a[i][2] - h[j]
        if s[j] == '/':
            tmp += 1 / 2
        elif s[j] == '\\':
            tmp -= 1 / 2
    b.append(int(tmp))
    tmp = 0

if len(b) != 0:
    i=0
    while True:
        if b[i] == 0:
            del b[i]
            i -= 1
        i += 1
        if i == len(b):
            break


A = sum(b)
k = len(b)

print(A)
print(k,end = '')
if k != 0:
    print(' ',end='')
    for i in range(k-1):
        print(b[i],end=' ')
    print(b[len(b)-1])
else:
    print('')
 s = str(input()) s str(input()) str input() input l = len(s) l len(s) len s h = [0] h [0] 0 for i in range(l):
    if s[i] == '\\':
        h.append(h[i]-1)
    elif s[i] == '/':
        h.append(h[i]+1)
    else:
        h.append(h[i]) i range(l) range l if s[i] == '\\':
        h.append(h[i]-1)
    elif s[i] == '/':
        h.append(h[i]+1)
    else:
        h.append(h[i]) s[i] == '\\' s[i] s i '\\' h.append(h[i]-1) h.append h append h[i]-1 h[i] h i 1 elif s[i] == '/':
        h.append(h[i]+1)
     s[i] == '/' s[i] s i '/' h.append(h[i]+1) h.append h append h[i]+1 h[i] h i 1 h.append(h[i]) h.append h append h[i] h i a = [] a [] m = -200000 m -200000 n = 0 n 0 for i in range(l+1):
    if m == h[i] and i != 0:
        a.append([n,i,m])
        m = -200000
    if m < h[i] or i == 0:
        m = h[i]
        n = i
    if (m in h[i+1:]) == False:
        m = -200000 i range(l+1) range l+1 l 1 if m == h[i] and i != 0:
        a.append([n,i,m])
        m = -200000
     m == h[i] and i != 0 m == h[i] m h[i] h i i != 0 i 0 a.append([n,i,m]) a.append a append [n,i,m] n i m m = -200000 m -200000 if m < h[i] or i == 0:
        m = h[i]
        n = i
     m < h[i] or i == 0 m < h[i] m h[i] h i i == 0 i 0 m = h[i] m h[i] h i n = i n i if (m in h[i+1:]) == False:
        m = -200000 (m in h[i+1:]) == False m in h[i+1:] m h[i+1:] h i+1: i+1 i 1 False m = -200000 m -200000 b = [] b [] tmp = 0 tmp 0 for i in range(len(a)):
    for j in range(a[i][0],a[i][1]):
        tmp += a[i][2] - h[j]
        if s[j] == '/':
            tmp += 1 / 2
        elif s[j] == '\\':
            tmp -= 1 / 2
    b.append(int(tmp))
    tmp = 0 i range(len(a)) range len(a) len a for j in range(a[i][0],a[i][1]):
        tmp += a[i][2] - h[j]
        if s[j] == '/':
            tmp += 1 / 2
        elif s[j] == '\\':
            tmp -= 1 / 2
     j range(a[i][0],a[i][1]) range a[i][0] [i] a i 0 a[i][1] [i] a i 1 tmp += a[i][2] - h[j] tmp a[i][2] - h[j] a[i][2] [i] a i 2 h[j] h j if s[j] == '/':
            tmp += 1 / 2
        elif s[j] == '\\':
            tmp -= 1 / 2
     s[j] == '/' s[j] s j '/' tmp += 1 / 2 tmp 1 / 2 1 2 elif s[j] == '\\':
            tmp -= 1 / 2
     s[j] == '\\' s[j] s j '\\' tmp -= 1 / 2 tmp 1 / 2 1 2 b.append(int(tmp)) b.append b append int(tmp) int tmp tmp = 0 tmp 0 if len(b) != 0:
    i=0
    while True:
        if b[i] == 0:
            del b[i]
            i -= 1
        i += 1
        if i == len(b):
            break len(b) != 0 len(b) len b 0 i=0 i 0 while True:
        if b[i] == 0:
            del b[i]
            i -= 1
        i += 1
        if i == len(b):
            break True if b[i] == 0:
            del b[i]
            i -= 1
         b[i] == 0 b[i] b i 0 del b[i] b[i] b i i -= 1 i 1 i += 1 i 1 if i == len(b):
            break i == len(b) i len(b) len b break A = sum(b) A sum(b) sum b k = len(b) k len(b) len b print(A) print A print(k,end = '') print k end = '' end '' if k != 0:
    print(' ',end='')
    for i in range(k-1):
        print(b[i],end=' ')
    print(b[len(b)-1])
else:
    print('') k != 0 k 0 print(' ',end='') print ' ' end='' end '' for i in range(k-1):
        print(b[i],end=' ')
     i range(k-1) range k-1 k 1 print(b[i],end=' ') print b[i] b i end=' ' end ' ' print(b[len(b)-1]) print b[len(b)-1] b len(b)-1 len(b) len b 1 print('') print '' tmp += a[i][2] - h[j] a[i][2] - h[j] tmp m = -200000 -200000 m tmp = 0 0 tmp s = str(input()) str(input()) s n = 0 0 n i=0 0 i i -= 1 1 i m = h[i] h[i] m n = i i n k = len(b) len(b) k m = -200000 -200000 m tmp += 1 / 2 1 / 2 tmp h = [0] [0] h m = -200000 -200000 m tmp -= 1 / 2 1 / 2 tmp l = len(s) len(s) l tmp = 0 0 tmp b = [] [] b A = sum(b) sum(b) A a = [] [] a i += 1 1 i
#https://onlinejudge.u-aizu.ac.jp/courses/lesson/1/ALDS1/3/ALDS1_3_D

s = str(input())
l = len(s)

h = [0]
for i in range(l):
    if s[i] == '\\':
        h.append(h[i]-1)
    elif s[i] == '/':
        h.append(h[i]+1)
    else:
        h.append(h[i])

a = []
m = -200000
n = 0
for i in range(l+1):
    if m == h[i] and i != 0:
        a.append([n,i,m])
        m = -200000
    if m < h[i] or i == 0:
        m = h[i]
        n = i
    if (m in h[i+1:]) == False:
        m = -200000

b = []
tmp = 0
for i in range(len(a)):
    for j in range(a[i][0],a[i][1]):
        tmp += a[i][2] - h[j]
        if s[j] == '/':
            tmp += 1 / 2
        elif s[j] == '\\':
            tmp -= 1 / 2
    b.append(int(tmp))
    tmp = 0

if len(b) != 0:
    i=0
    while True:
        if b[i] == 0:
            del b[i]
            i -= 1
        i += 1
        if i == len(b):
            break


A = sum(b)
k = len(b)

print(A)
print(k,end = '')
if k != 0:
    print(' ',end='')
    for i in range(k-1):
        print(b[i],end=' ')
    print(b[len(b)-1])
else:
    print('')

