S = input()

l1 = []
l2 = []
total_area = 0
for i, j in enumerate(S):
    if j == '\\':
        l1.append(i)
    elif j == '/' and l1:
        i_p = l1.pop()
        v = i -i_p
        total_area += v
    
        while l2 and l2[-1][0] > i_p:
            v += l2.pop()[1]
        l2.append([i_p, v])
        
ans = [str(len(l2))] + [str(k[1]) for k in l2]
print(total_area)
print(' '.join(ans)) S = input() S input() input l1 = [] l1 [] l2 = [] l2 [] total_area = 0 total_area 0 for i, j in enumerate(S):
    if j == '\\':
        l1.append(i)
    elif j == '/' and l1:
        i_p = l1.pop()
        v = i -i_p
        total_area += v
    
        while l2 and l2[-1][0] > i_p:
            v += l2.pop()[1]
        l2.append([i_p, v])
         i j enumerate(S) enumerate S if j == '\\':
        l1.append(i)
    elif j == '/' and l1:
        i_p = l1.pop()
        v = i -i_p
        total_area += v
    
        while l2 and l2[-1][0] > i_p:
            v += l2.pop()[1]
        l2.append([i_p, v])
         j == '\\' j '\\' l1.append(i) l1.append l1 append i elif j == '/' and l1:
        i_p = l1.pop()
        v = i -i_p
        total_area += v
    
        while l2 and l2[-1][0] > i_p:
            v += l2.pop()[1]
        l2.append([i_p, v])
         j == '/' and l1 j == '/' j '/' l1 i_p = l1.pop() i_p l1.pop() l1.pop l1 pop v = i -i_p v i -i_p i i_p total_area += v total_area v while l2 and l2[-1][0] > i_p:
            v += l2.pop()[1]
         l2 and l2[-1][0] > i_p l2 l2[-1][0] > i_p l2[-1][0] [-1] l2 -1 0 i_p v += l2.pop()[1] v l2.pop()[1] l2.pop() l2.pop l2 pop 1 l2.append([i_p, v]) l2.append l2 append [i_p, v] i_p v str(k[1]) for k in l2 for k in l2 k l2 for k in l2 str(k[1]) str k[1] k 1 ans = [str(len(l2))] + [str(k[1]) for k in l2] ans [str(len(l2))] + [str(k[1]) for k in l2] [str(len(l2))] str(len(l2)) str len(l2) len l2 [str(k[1]) for k in l2] print(total_area) print total_area print(' '.join(ans)) print ' '.join(ans) ' '.join ' ' join ans v += l2.pop()[1] l2.pop()[1] v total_area = 0 0 total_area total_area += v v total_area i_p = l1.pop() l1.pop() i_p S = input() input() S v = i -i_p i -i_p v l2 = [] [] l2 l1 = [] [] l1 ans = [str(len(l2))] + [str(k[1]) for k in l2] [str(len(l2))] + [str(k[1]) for k in l2] ans
S = input()

l1 = []
l2 = []
total_area = 0
for i, j in enumerate(S):
    if j == '\\':
        l1.append(i)
    elif j == '/' and l1:
        i_p = l1.pop()
        v = i -i_p
        total_area += v
    
        while l2 and l2[-1][0] > i_p:
            v += l2.pop()[1]
        l2.append([i_p, v])
        
ans = [str(len(l2))] + [str(k[1]) for k in l2]
print(total_area)
print(' '.join(ans))
