def func(c):
    global cnt
    cnt += {'_':0, '/':1, '\\':-1}[c]
    return cnt

cnt = 0
g = [[0, False]] + [[func(c), False] for c in input()]

gmax = g[0][0]
for i in range(1, len(g)):
    if g[i - 1][0] < g[i][0] <= gmax :
        g[i][1] = True
    gmax = max(gmax, g[i][0])

puddles = []
volume = 0
saface_level = None

for i in range(len(g) - 1, -1, -1):
    if saface_level != None:
        volume += saface_level  - g[i][0]
        if saface_level == g[i][0]:
            puddles += [volume]
            saface_level = None
            volume = 0
    if saface_level == None and g[i][1]:
        saface_level = g[i][0] 

puddles = puddles[::-1]
print(sum(puddles))
print(len(puddles), *puddles) def func(c):
    global cnt
    cnt += {'_':0, '/':1, '\\':-1}[c]
    return cnt func global cnt cnt += {'_':0, '/':1, '\\':-1}[c] cnt {'_':0, '/':1, '\\':-1}[c] {'_':0, '/':1, '\\':-1} '_' '_' 0 '/' '/' 1 '\\' '\\' -1 c return cnt cnt c c cnt = 0 cnt 0 [func(c), False] for c in input() for c in input() c input() input for c in input() [func(c), False] func(c) func c False g = [[0, False]] + [[func(c), False] for c in input()] g [[0, False]] + [[func(c), False] for c in input()] [[0, False]] [0, False] 0 False [[func(c), False] for c in input()] gmax = g[0][0] gmax g[0][0] [0] g 0 0 for i in range(1, len(g)):
    if g[i - 1][0] < g[i][0] <= gmax :
        g[i][1] = True
    gmax = max(gmax, g[i][0]) i range(1, len(g)) range 1 len(g) len g if g[i - 1][0] < g[i][0] <= gmax :
        g[i][1] = True
     g[i - 1][0] < g[i][0] <= gmax g[i - 1][0] < g[i][0] g[i - 1][0] [i - 1] g i - 1 i 1 0 g[i][0] [i] g i 0 gmax g[i][1] = True g[i][1] [i] g i 1 True gmax = max(gmax, g[i][0]) gmax max(gmax, g[i][0]) max gmax g[i][0] [i] g i 0 puddles = [] puddles [] volume = 0 volume 0 saface_level = None saface_level None for i in range(len(g) - 1, -1, -1):
    if saface_level != None:
        volume += saface_level  - g[i][0]
        if saface_level == g[i][0]:
            puddles += [volume]
            saface_level = None
            volume = 0
    if saface_level == None and g[i][1]:
        saface_level = g[i][0]  i range(len(g) - 1, -1, -1) range len(g) - 1 len(g) len g 1 -1 -1 if saface_level != None:
        volume += saface_level  - g[i][0]
        if saface_level == g[i][0]:
            puddles += [volume]
            saface_level = None
            volume = 0
     saface_level != None saface_level None volume += saface_level  - g[i][0] volume saface_level  - g[i][0] saface_level g[i][0] [i] g i 0 if saface_level == g[i][0]:
            puddles += [volume]
            saface_level = None
            volume = 0
     saface_level == g[i][0] saface_level g[i][0] [i] g i 0 puddles += [volume] puddles [volume] volume saface_level = None saface_level None volume = 0 volume 0 if saface_level == None and g[i][1]:
        saface_level = g[i][0]  saface_level == None and g[i][1] saface_level == None saface_level None g[i][1] [i] g i 1 saface_level = g[i][0] saface_level g[i][0] [i] g i 0 puddles = puddles[::-1] puddles puddles[::-1] puddles ::-1 -1 print(sum(puddles)) print sum(puddles) sum puddles print(len(puddles), *puddles) print len(puddles) len puddles *puddles puddles g = [[0, False]] + [[func(c), False] for c in input()] [[0, False]] + [[func(c), False] for c in input()] g puddles = [] [] puddles saface_level = g[i][0] g[i][0] saface_level puddles = puddles[::-1] puddles[::-1] puddles volume = 0 0 volume gmax = max(gmax, g[i][0]) max(gmax, g[i][0]) gmax volume += saface_level  - g[i][0] saface_level  - g[i][0] volume saface_level = None None saface_level gmax = g[0][0] g[0][0] gmax saface_level = None None saface_level def func(c):
    global cnt
    cnt += {'_':0, '/':1, '\\':-1}[c]
    return cnt def func(c):
    global cnt
    cnt += {'_':0, '/':1, '\\':-1}[c]
    return cnt func cnt = 0 0 cnt volume = 0 0 volume puddles += [volume] [volume] puddles
def func(c):
    global cnt
    cnt += {'_':0, '/':1, '\\':-1}[c]
    return cnt

cnt = 0
g = [[0, False]] + [[func(c), False] for c in input()]

gmax = g[0][0]
for i in range(1, len(g)):
    if g[i - 1][0] < g[i][0] <= gmax :
        g[i][1] = True
    gmax = max(gmax, g[i][0])

puddles = []
volume = 0
saface_level = None

for i in range(len(g) - 1, -1, -1):
    if saface_level != None:
        volume += saface_level  - g[i][0]
        if saface_level == g[i][0]:
            puddles += [volume]
            saface_level = None
            volume = 0
    if saface_level == None and g[i][1]:
        saface_level = g[i][0] 

puddles = puddles[::-1]
print(sum(puddles))
print(len(puddles), *puddles)