s = input()
stack = []
n = len(s)

ans = 0
prev = 0
each = []
for i in range(n):
    if s[i] == '\\':
        stack.append(i)
    elif s[i] == '_':
        pass
    else:
        if len(stack) != 0:
            idx = stack.pop()
            ans += (i - idx)
            if len(stack) == 0:
                each.append(ans - prev)
                prev = ans

each2 = []
stack2 = []
ans2 = 0
prev2 = 0
if len(stack) >= 1:
    for i in range(n-1,stack[0],-1):
        if s[i] == '/':
            stack2.append(i)
        elif s[i] == '_':
            pass
        else:
            if len(stack2) != 0:
                idx = stack2.pop()
                ans2 += (idx - i)
                if len(stack2) == 0:
                    each2.append(ans2 - prev2)
                    prev2 = ans2
each2.reverse()
each.extend(each2)
print(ans)
if len(each) == 0:
    print(len(each))
else:
    print(len(each),end=" ")
    print(*each)
 s = input() s input() input stack = [] stack [] n = len(s) n len(s) len s ans = 0 ans 0 prev = 0 prev 0 each = [] each [] for i in range(n):
    if s[i] == '\\':
        stack.append(i)
    elif s[i] == '_':
        pass
    else:
        if len(stack) != 0:
            idx = stack.pop()
            ans += (i - idx)
            if len(stack) == 0:
                each.append(ans - prev)
                prev = ans i range(n) range n if s[i] == '\\':
        stack.append(i)
    elif s[i] == '_':
        pass
    else:
        if len(stack) != 0:
            idx = stack.pop()
            ans += (i - idx)
            if len(stack) == 0:
                each.append(ans - prev)
                prev = ans s[i] == '\\' s[i] s i '\\' stack.append(i) stack.append stack append i elif s[i] == '_':
        pass
     s[i] == '_' s[i] s i '_' if len(stack) != 0:
            idx = stack.pop()
            ans += (i - idx)
            if len(stack) == 0:
                each.append(ans - prev)
                prev = ans len(stack) != 0 len(stack) len stack 0 idx = stack.pop() idx stack.pop() stack.pop stack pop ans += (i - idx) ans i - idx i idx if len(stack) == 0:
                each.append(ans - prev)
                prev = ans len(stack) == 0 len(stack) len stack 0 each.append(ans - prev) each.append each append ans - prev ans prev prev = ans prev ans each2 = [] each2 [] stack2 = [] stack2 [] ans2 = 0 ans2 0 prev2 = 0 prev2 0 if len(stack) >= 1:
    for i in range(n-1,stack[0],-1):
        if s[i] == '/':
            stack2.append(i)
        elif s[i] == '_':
            pass
        else:
            if len(stack2) != 0:
                idx = stack2.pop()
                ans2 += (idx - i)
                if len(stack2) == 0:
                    each2.append(ans2 - prev2)
                    prev2 = ans2 len(stack) >= 1 len(stack) len stack 1 for i in range(n-1,stack[0],-1):
        if s[i] == '/':
            stack2.append(i)
        elif s[i] == '_':
            pass
        else:
            if len(stack2) != 0:
                idx = stack2.pop()
                ans2 += (idx - i)
                if len(stack2) == 0:
                    each2.append(ans2 - prev2)
                    prev2 = ans2 i range(n-1,stack[0],-1) range n-1 n 1 stack[0] stack 0 -1 if s[i] == '/':
            stack2.append(i)
        elif s[i] == '_':
            pass
        else:
            if len(stack2) != 0:
                idx = stack2.pop()
                ans2 += (idx - i)
                if len(stack2) == 0:
                    each2.append(ans2 - prev2)
                    prev2 = ans2 s[i] == '/' s[i] s i '/' stack2.append(i) stack2.append stack2 append i elif s[i] == '_':
            pass
         s[i] == '_' s[i] s i '_' if len(stack2) != 0:
                idx = stack2.pop()
                ans2 += (idx - i)
                if len(stack2) == 0:
                    each2.append(ans2 - prev2)
                    prev2 = ans2 len(stack2) != 0 len(stack2) len stack2 0 idx = stack2.pop() idx stack2.pop() stack2.pop stack2 pop ans2 += (idx - i) ans2 idx - i idx i if len(stack2) == 0:
                    each2.append(ans2 - prev2)
                    prev2 = ans2 len(stack2) == 0 len(stack2) len stack2 0 each2.append(ans2 - prev2) each2.append each2 append ans2 - prev2 ans2 prev2 prev2 = ans2 prev2 ans2 each2.reverse() each2.reverse each2 reverse each.extend(each2) each.extend each extend each2 print(ans) print ans if len(each) == 0:
    print(len(each))
else:
    print(len(each),end=" ")
    print(*each) len(each) == 0 len(each) len each 0 print(len(each)) print len(each) len each print(len(each),end=" ") print len(each) len each end=" " end " " print(*each) print *each each prev2 = ans2 ans2 prev2 s = input() input() s each = [] [] each prev2 = 0 0 prev2 ans2 += (idx - i) idx - i ans2 stack = [] [] stack ans += (i - idx) i - idx ans each2 = [] [] each2 idx = stack2.pop() stack2.pop() idx stack2 = [] [] stack2 idx = stack.pop() stack.pop() idx ans = 0 0 ans prev = 0 0 prev n = len(s) len(s) n prev = ans ans prev ans2 = 0 0 ans2
s = input()
stack = []
n = len(s)

ans = 0
prev = 0
each = []
for i in range(n):
    if s[i] == '\\':
        stack.append(i)
    elif s[i] == '_':
        pass
    else:
        if len(stack) != 0:
            idx = stack.pop()
            ans += (i - idx)
            if len(stack) == 0:
                each.append(ans - prev)
                prev = ans

each2 = []
stack2 = []
ans2 = 0
prev2 = 0
if len(stack) >= 1:
    for i in range(n-1,stack[0],-1):
        if s[i] == '/':
            stack2.append(i)
        elif s[i] == '_':
            pass
        else:
            if len(stack2) != 0:
                idx = stack2.pop()
                ans2 += (idx - i)
                if len(stack2) == 0:
                    each2.append(ans2 - prev2)
                    prev2 = ans2
each2.reverse()
each.extend(each2)
print(ans)
if len(each) == 0:
    print(len(each))
else:
    print(len(each),end=" ")
    print(*each)

