str = list(input())

a = []
all = 0
areas = []
for i in range(len(str)):
    if str[i] == "\\":
        a.append(i)
    elif str[i] == "/" and len(a) > 0:
        j = a.pop()
        b = i - j
        all += b
        while(len(areas) > 0 and areas[-1][0] > j):
            b += areas.pop()[1]
        areas.append([j, b])

print(int(all))
if len(areas) > 0:
    print(len(areas), *[areas[i][1] for i in range(len(areas))])
else:
    print(0)

 str = list(input()) str list(input()) list input() input a = [] a [] all = 0 all 0 areas = [] areas [] for i in range(len(str)):
    if str[i] == "\\":
        a.append(i)
    elif str[i] == "/" and len(a) > 0:
        j = a.pop()
        b = i - j
        all += b
        while(len(areas) > 0 and areas[-1][0] > j):
            b += areas.pop()[1]
        areas.append([j, b]) i range(len(str)) range len(str) len str if str[i] == "\\":
        a.append(i)
    elif str[i] == "/" and len(a) > 0:
        j = a.pop()
        b = i - j
        all += b
        while(len(areas) > 0 and areas[-1][0] > j):
            b += areas.pop()[1]
        areas.append([j, b]) str[i] == "\\" str[i] str i "\\" a.append(i) a.append a append i elif str[i] == "/" and len(a) > 0:
        j = a.pop()
        b = i - j
        all += b
        while(len(areas) > 0 and areas[-1][0] > j):
            b += areas.pop()[1]
        areas.append([j, b]) str[i] == "/" and len(a) > 0 str[i] == "/" str[i] str i "/" len(a) > 0 len(a) len a 0 j = a.pop() j a.pop() a.pop a pop b = i - j b i - j i j all += b all b while(len(areas) > 0 and areas[-1][0] > j):
            b += areas.pop()[1]
         len(areas) > 0 and areas[-1][0] > j len(areas) > 0 len(areas) len areas 0 areas[-1][0] > j areas[-1][0] [-1] areas -1 0 j b += areas.pop()[1] b areas.pop()[1] areas.pop() areas.pop areas pop 1 areas.append([j, b]) areas.append areas append [j, b] j b print(int(all)) print int(all) int all if len(areas) > 0:
    print(len(areas), *[areas[i][1] for i in range(len(areas))])
else:
    print(0) len(areas) > 0 len(areas) len areas 0 areas[i][1] for i in range(len(areas)) for i in range(len(areas)) i range(len(areas)) range len(areas) len areas for i in range(len(areas)) areas[i][1] [i] areas i 1 print(len(areas), *[areas[i][1] for i in range(len(areas))]) print len(areas) len areas *[areas[i][1] for i in range(len(areas))] [areas[i][1] for i in range(len(areas))] print(0) print 0 b += areas.pop()[1] areas.pop()[1] b areas = [] [] areas a = [] [] a all = 0 0 all j = a.pop() a.pop() j all += b b all b = i - j i - j b str = list(input()) list(input()) str
str = list(input())

a = []
all = 0
areas = []
for i in range(len(str)):
    if str[i] == "\\":
        a.append(i)
    elif str[i] == "/" and len(a) > 0:
        j = a.pop()
        b = i - j
        all += b
        while(len(areas) > 0 and areas[-1][0] > j):
            b += areas.pop()[1]
        areas.append([j, b])

print(int(all))
if len(areas) > 0:
    print(len(areas), *[areas[i][1] for i in range(len(areas))])
else:
    print(0)


