s1 = []
s2 = []
a = 0
s = input()
for i in range(len(s)):
    if s[i] == "\\":
        s1.append(i)
    elif s[i] == "/" and len(s1)>0:
        j = s1.pop()#position of nearest \
        a += i-j
        a_splt = i-j
        while(len(s2) > 0 and s2[-1][0] > j):
            a_splt += s2.pop()[1]
        s2.append([j, a_splt])

print(a)
ans = ""
ans += str(len(s2))
for area in s2:
    ans += " " + str(area[1])
print(ans) s1 = [] s1 [] s2 = [] s2 [] a = 0 a 0 s = input() s input() input for i in range(len(s)):
    if s[i] == "\\":
        s1.append(i)
    elif s[i] == "/" and len(s1)>0:
        j = s1.pop()#position of nearest \
        a += i-j
        a_splt = i-j
        while(len(s2) > 0 and s2[-1][0] > j):
            a_splt += s2.pop()[1]
        s2.append([j, a_splt]) i range(len(s)) range len(s) len s if s[i] == "\\":
        s1.append(i)
    elif s[i] == "/" and len(s1)>0:
        j = s1.pop()#position of nearest \
        a += i-j
        a_splt = i-j
        while(len(s2) > 0 and s2[-1][0] > j):
            a_splt += s2.pop()[1]
        s2.append([j, a_splt]) s[i] == "\\" s[i] s i "\\" s1.append(i) s1.append s1 append i elif s[i] == "/" and len(s1)>0:
        j = s1.pop()#position of nearest \
        a += i-j
        a_splt = i-j
        while(len(s2) > 0 and s2[-1][0] > j):
            a_splt += s2.pop()[1]
        s2.append([j, a_splt]) s[i] == "/" and len(s1)>0 s[i] == "/" s[i] s i "/" len(s1)>0 len(s1) len s1 0 j = s1.pop() j s1.pop() s1.pop s1 pop a += i-j a i-j i j a_splt = i-j a_splt i-j i j while(len(s2) > 0 and s2[-1][0] > j):
            a_splt += s2.pop()[1]
         len(s2) > 0 and s2[-1][0] > j len(s2) > 0 len(s2) len s2 0 s2[-1][0] > j s2[-1][0] [-1] s2 -1 0 j a_splt += s2.pop()[1] a_splt s2.pop()[1] s2.pop() s2.pop s2 pop 1 s2.append([j, a_splt]) s2.append s2 append [j, a_splt] j a_splt print(a) print a ans = "" ans "" ans += str(len(s2)) ans str(len(s2)) str len(s2) len s2 for area in s2:
    ans += " " + str(area[1]) area s2 ans += " " + str(area[1]) ans " " + str(area[1]) " " str(area[1]) str area[1] area 1 print(ans) print ans s1 = [] [] s1 ans = "" "" ans a_splt += s2.pop()[1] s2.pop()[1] a_splt ans += " " + str(area[1]) " " + str(area[1]) ans s = input() input() s a = 0 0 a ans += str(len(s2)) str(len(s2)) ans s2 = [] [] s2 j = s1.pop() s1.pop() j a_splt = i-j i-j a_splt a += i-j i-j a
s1 = []
s2 = []
a = 0
s = input()
for i in range(len(s)):
    if s[i] == "\\":
        s1.append(i)
    elif s[i] == "/" and len(s1)>0:
        j = s1.pop()#position of nearest \
        a += i-j
        a_splt = i-j
        while(len(s2) > 0 and s2[-1][0] > j):
            a_splt += s2.pop()[1]
        s2.append([j, a_splt])

print(a)
ans = ""
ans += str(len(s2))
for area in s2:
    ans += " " + str(area[1])
print(ans)
