landform = [c for c in input()]
down = []
areas = []

for i in range(len(landform)):
    if landform[i] == '\\':
        down.append(i)
    if landform[i] == '/':
        if down:
            pair = down.pop()
            area = i - pair
            while areas and areas[-1][0] > pair:
                area += areas.pop()[1]
            areas.append([pair, area])

sum_area = 0
for area in areas:
    sum_area += area[1]
print(sum_area)

ans = []
ans.append(str(len(areas)))
ans += [str(area[1]) for area in areas]

print(' '.join(ans))
 c for c in input() for c in input() c input() input for c in input() c landform = [c for c in input()] landform [c for c in input()] down = [] down [] areas = [] areas [] for i in range(len(landform)):
    if landform[i] == '\\':
        down.append(i)
    if landform[i] == '/':
        if down:
            pair = down.pop()
            area = i - pair
            while areas and areas[-1][0] > pair:
                area += areas.pop()[1]
            areas.append([pair, area]) i range(len(landform)) range len(landform) len landform if landform[i] == '\\':
        down.append(i)
     landform[i] == '\\' landform[i] landform i '\\' down.append(i) down.append down append i if landform[i] == '/':
        if down:
            pair = down.pop()
            area = i - pair
            while areas and areas[-1][0] > pair:
                area += areas.pop()[1]
            areas.append([pair, area]) landform[i] == '/' landform[i] landform i '/' if down:
            pair = down.pop()
            area = i - pair
            while areas and areas[-1][0] > pair:
                area += areas.pop()[1]
            areas.append([pair, area]) down pair = down.pop() pair down.pop() down.pop down pop area = i - pair area i - pair i pair while areas and areas[-1][0] > pair:
                area += areas.pop()[1]
             areas and areas[-1][0] > pair areas areas[-1][0] > pair areas[-1][0] [-1] areas -1 0 pair area += areas.pop()[1] area areas.pop()[1] areas.pop() areas.pop areas pop 1 areas.append([pair, area]) areas.append areas append [pair, area] pair area sum_area = 0 sum_area 0 for area in areas:
    sum_area += area[1] area areas sum_area += area[1] sum_area area[1] area 1 print(sum_area) print sum_area ans = [] ans [] ans.append(str(len(areas))) ans.append ans append str(len(areas)) str len(areas) len areas str(area[1]) for area in areas for area in areas area areas for area in areas str(area[1]) str area[1] area 1 ans += [str(area[1]) for area in areas] ans [str(area[1]) for area in areas] print(' '.join(ans)) print ' '.join(ans) ' '.join ' ' join ans down = [] [] down area = i - pair i - pair area area += areas.pop()[1] areas.pop()[1] area pair = down.pop() down.pop() pair ans += [str(area[1]) for area in areas] [str(area[1]) for area in areas] ans sum_area += area[1] area[1] sum_area landform = [c for c in input()] [c for c in input()] landform areas = [] [] areas ans = [] [] ans sum_area = 0 0 sum_area
landform = [c for c in input()]
down = []
areas = []

for i in range(len(landform)):
    if landform[i] == '\\':
        down.append(i)
    if landform[i] == '/':
        if down:
            pair = down.pop()
            area = i - pair
            while areas and areas[-1][0] > pair:
                area += areas.pop()[1]
            areas.append([pair, area])

sum_area = 0
for area in areas:
    sum_area += area[1]
print(sum_area)

ans = []
ans.append(str(len(areas)))
ans += [str(area[1]) for area in areas]

print(' '.join(ans))

