A = input()
st = [(0, 0, -1)]
cur = 0; ma = 0
for i, a in enumerate(A):
    if a == '/':
        cur += 1
        s = 0
        while st and st[-1][0] == cur-1 and cur <= ma:
            lev, su, j = st.pop()
            s += su
        if st and st[-1][0] == cur:
            s += i - st[-1][2] - 1
        ma = max(ma, cur)
        st.append((cur, s, i))
    elif a == '\\':
        cur -= 1
        st.append((cur, 0, i))
    elif a == '_':
        st.append((cur, 0, i))
ans = []
for lev, su, j in st:
    if su > 0:
        ans.append(su)
print(sum(ans))
print(len(ans), *ans) A = input() A input() input st = [(0, 0, -1)] st [(0, 0, -1)] (0, 0, -1) 0 0 -1 cur = 0 cur 0 ma = 0 ma 0 for i, a in enumerate(A):
    if a == '/':
        cur += 1
        s = 0
        while st and st[-1][0] == cur-1 and cur <= ma:
            lev, su, j = st.pop()
            s += su
        if st and st[-1][0] == cur:
            s += i - st[-1][2] - 1
        ma = max(ma, cur)
        st.append((cur, s, i))
    elif a == '\\':
        cur -= 1
        st.append((cur, 0, i))
    elif a == '_':
        st.append((cur, 0, i)) i a enumerate(A) enumerate A if a == '/':
        cur += 1
        s = 0
        while st and st[-1][0] == cur-1 and cur <= ma:
            lev, su, j = st.pop()
            s += su
        if st and st[-1][0] == cur:
            s += i - st[-1][2] - 1
        ma = max(ma, cur)
        st.append((cur, s, i))
    elif a == '\\':
        cur -= 1
        st.append((cur, 0, i))
    elif a == '_':
        st.append((cur, 0, i)) a == '/' a '/' cur += 1 cur 1 s = 0 s 0 while st and st[-1][0] == cur-1 and cur <= ma:
            lev, su, j = st.pop()
            s += su
         st and st[-1][0] == cur-1 and cur <= ma st and st[-1][0] == cur-1 st st[-1][0] == cur-1 st[-1][0] [-1] st -1 0 cur-1 cur 1 cur <= ma cur ma lev, su, j = st.pop() lev st.pop() st.pop st pop su j s += su s su if st and st[-1][0] == cur:
            s += i - st[-1][2] - 1
         st and st[-1][0] == cur st st[-1][0] == cur st[-1][0] [-1] st -1 0 cur s += i - st[-1][2] - 1 s i - st[-1][2] - 1 i - st[-1][2] i st[-1][2] [-1] st -1 2 1 ma = max(ma, cur) ma max(ma, cur) max ma cur st.append((cur, s, i)) st.append st append (cur, s, i) cur s i elif a == '\\':
        cur -= 1
        st.append((cur, 0, i))
     a == '\\' a '\\' cur -= 1 cur 1 st.append((cur, 0, i)) st.append st append (cur, 0, i) cur 0 i elif a == '_':
        st.append((cur, 0, i)) a == '_' a '_' st.append((cur, 0, i)) st.append st append (cur, 0, i) cur 0 i ans = [] ans [] for lev, su, j in st:
    if su > 0:
        ans.append(su) lev su j st if su > 0:
        ans.append(su) su > 0 su 0 ans.append(su) ans.append ans append su print(sum(ans)) print sum(ans) sum ans print(len(ans), *ans) print len(ans) len ans *ans ans s += su su s s += i - st[-1][2] - 1 i - st[-1][2] - 1 s ma = max(ma, cur) max(ma, cur) ma A = input() input() A j = st.pop() st.pop() j cur = 0 0 cur su, j = st.pop() st.pop() su lev, su, j = st.pop() st.pop() lev cur += 1 1 cur ma = 0 0 ma cur -= 1 1 cur ans = [] [] ans s = 0 0 s st = [(0, 0, -1)] [(0, 0, -1)] st
A = input()
st = [(0, 0, -1)]
cur = 0; ma = 0
for i, a in enumerate(A):
    if a == '/':
        cur += 1
        s = 0
        while st and st[-1][0] == cur-1 and cur <= ma:
            lev, su, j = st.pop()
            s += su
        if st and st[-1][0] == cur:
            s += i - st[-1][2] - 1
        ma = max(ma, cur)
        st.append((cur, s, i))
    elif a == '\\':
        cur -= 1
        st.append((cur, 0, i))
    elif a == '_':
        st.append((cur, 0, i))
ans = []
for lev, su, j in st:
    if su > 0:
        ans.append(su)
print(sum(ans))
print(len(ans), *ans)
