
strSlopeFlat = list(input())

stack_total = []
starck_areas = []

for i,x in enumerate(strSlopeFlat):
    if x == '\\':
        stack_total.append(i)
    elif x == '/' :
        onearea = 0
        if len(stack_total) > 0:
            pos = stack_total.pop()
            onearea = (i-pos)
            while len(starck_areas)>0 and starck_areas[-1][0] > pos:
                tmp_pop = starck_areas.pop()
                onearea += tmp_pop[1]
            starck_areas.append([pos,onearea])

print(sum([y for x,y in starck_areas]))
results = [x[1]  for x in starck_areas if x[1] != 0]
print(len(results),*results) strSlopeFlat = list(input()) strSlopeFlat list(input()) list input() input stack_total = [] stack_total [] starck_areas = [] starck_areas [] for i,x in enumerate(strSlopeFlat):
    if x == '\\':
        stack_total.append(i)
    elif x == '/' :
        onearea = 0
        if len(stack_total) > 0:
            pos = stack_total.pop()
            onearea = (i-pos)
            while len(starck_areas)>0 and starck_areas[-1][0] > pos:
                tmp_pop = starck_areas.pop()
                onearea += tmp_pop[1]
            starck_areas.append([pos,onearea]) i x enumerate(strSlopeFlat) enumerate strSlopeFlat if x == '\\':
        stack_total.append(i)
    elif x == '/' :
        onearea = 0
        if len(stack_total) > 0:
            pos = stack_total.pop()
            onearea = (i-pos)
            while len(starck_areas)>0 and starck_areas[-1][0] > pos:
                tmp_pop = starck_areas.pop()
                onearea += tmp_pop[1]
            starck_areas.append([pos,onearea]) x == '\\' x '\\' stack_total.append(i) stack_total.append stack_total append i elif x == '/' :
        onearea = 0
        if len(stack_total) > 0:
            pos = stack_total.pop()
            onearea = (i-pos)
            while len(starck_areas)>0 and starck_areas[-1][0] > pos:
                tmp_pop = starck_areas.pop()
                onearea += tmp_pop[1]
            starck_areas.append([pos,onearea]) x == '/' x '/' onearea = 0 onearea 0 if len(stack_total) > 0:
            pos = stack_total.pop()
            onearea = (i-pos)
            while len(starck_areas)>0 and starck_areas[-1][0] > pos:
                tmp_pop = starck_areas.pop()
                onearea += tmp_pop[1]
            starck_areas.append([pos,onearea]) len(stack_total) > 0 len(stack_total) len stack_total 0 pos = stack_total.pop() pos stack_total.pop() stack_total.pop stack_total pop onearea = (i-pos) onearea i-pos i pos while len(starck_areas)>0 and starck_areas[-1][0] > pos:
                tmp_pop = starck_areas.pop()
                onearea += tmp_pop[1]
             len(starck_areas)>0 and starck_areas[-1][0] > pos len(starck_areas)>0 len(starck_areas) len starck_areas 0 starck_areas[-1][0] > pos starck_areas[-1][0] [-1] starck_areas -1 0 pos tmp_pop = starck_areas.pop() tmp_pop starck_areas.pop() starck_areas.pop starck_areas pop onearea += tmp_pop[1] onearea tmp_pop[1] tmp_pop 1 starck_areas.append([pos,onearea]) starck_areas.append starck_areas append [pos,onearea] pos onearea y for x,y in starck_areas for x,y in starck_areas x y starck_areas for x,y in starck_areas y print(sum([y for x,y in starck_areas])) print sum([y for x,y in starck_areas]) sum [y for x,y in starck_areas] x[1]  for x in starck_areas if x[1] != 0 for x in starck_areas if x[1] != 0 x starck_areas x[1] != 0 x[1] x 1 0 if x[1] != 0 x[1] x 1 results = [x[1]  for x in starck_areas if x[1] != 0] results [x[1]  for x in starck_areas if x[1] != 0] print(len(results),*results) print len(results) len results *results results stack_total = [] [] stack_total onearea = (i-pos) i-pos onearea pos = stack_total.pop() stack_total.pop() pos results = [x[1]  for x in starck_areas if x[1] != 0] [x[1]  for x in starck_areas if x[1] != 0] results onearea += tmp_pop[1] tmp_pop[1] onearea tmp_pop = starck_areas.pop() starck_areas.pop() tmp_pop starck_areas = [] [] starck_areas onearea = 0 0 onearea strSlopeFlat = list(input()) list(input()) strSlopeFlat

strSlopeFlat = list(input())

stack_total = []
starck_areas = []

for i,x in enumerate(strSlopeFlat):
    if x == '\\':
        stack_total.append(i)
    elif x == '/' :
        onearea = 0
        if len(stack_total) > 0:
            pos = stack_total.pop()
            onearea = (i-pos)
            while len(starck_areas)>0 and starck_areas[-1][0] > pos:
                tmp_pop = starck_areas.pop()
                onearea += tmp_pop[1]
            starck_areas.append([pos,onearea])

print(sum([y for x,y in starck_areas]))
results = [x[1]  for x in starck_areas if x[1] != 0]
print(len(results),*results)