s = input()
highest, high, h, mh = [0], [0], 0, 0
for i in range(len(s)):
    if s[-i-1] == '\\':     h += 1
    elif s[-i-1] == "/":    h -= 1
    
    if mh < h:  mh = h
    
    high.append(h)
    highest.append(mh)

high, highest = high[::-1], highest[::-1]
puddle, h = [], high[0]
v, vsum = 0, 0
for i in range(1, len(s) + 1):
    h = min(h, highest[i])
    if high[i] < h:
        if s[i-1] != "_":
            v -= 0.5
        v += h - min(high[i-1], high[i])
    elif v != 0:
        v = int(v + 0.5)
        puddle.append(v)
        vsum += v
        v, h = 0, high[i]
    else:
        h = high[i]
        
print(vsum)
if len(puddle) != 0:
    print(len(puddle), ' '.join(list(map(str, puddle))))
else:
    print(0) s = input() s input() input highest, high, h, mh = [0], [0], 0, 0 highest [0] 0 high [0] 0 h 0 mh 0 for i in range(len(s)):
    if s[-i-1] == '\\':     h += 1
    elif s[-i-1] == "/":    h -= 1
    
    if mh < h:  mh = h
    
    high.append(h)
    highest.append(mh) i range(len(s)) range len(s) len s if s[-i-1] == '\\':     h += 1
    elif s[-i-1] == "/":    h -= 1
    
     s[-i-1] == '\\' s[-i-1] s -i-1 -i i 1 '\\' elif s[-i-1] == "/":    h -= 1
    
     s[-i-1] == "/" s[-i-1] s -i-1 -i i 1 "/" if mh < h:  mh = h
    
     mh < h mh h high.append(h) high.append high append h highest.append(mh) highest.append highest append mh high, highest = high[::-1], highest[::-1] high high[::-1] high ::-1 -1 highest highest[::-1] highest ::-1 -1 puddle, h = [], high[0] puddle [] h high[0] high 0 v, vsum = 0, 0 v 0 vsum 0 for i in range(1, len(s) + 1):
    h = min(h, highest[i])
    if high[i] < h:
        if s[i-1] != "_":
            v -= 0.5
        v += h - min(high[i-1], high[i])
    elif v != 0:
        v = int(v + 0.5)
        puddle.append(v)
        vsum += v
        v, h = 0, high[i]
    else:
        h = high[i]
         i range(1, len(s) + 1) range 1 len(s) + 1 len(s) len s 1 h = min(h, highest[i]) h min(h, highest[i]) min h highest[i] highest i if high[i] < h:
        if s[i-1] != "_":
            v -= 0.5
        v += h - min(high[i-1], high[i])
    elif v != 0:
        v = int(v + 0.5)
        puddle.append(v)
        vsum += v
        v, h = 0, high[i]
    else:
        h = high[i]
         high[i] < h high[i] high i h if s[i-1] != "_":
            v -= 0.5
         s[i-1] != "_" s[i-1] s i-1 i 1 "_" v -= 0.5 v 0.5 v += h - min(high[i-1], high[i]) v h - min(high[i-1], high[i]) h min(high[i-1], high[i]) min high[i-1] high i-1 i 1 high[i] high i elif v != 0:
        v = int(v + 0.5)
        puddle.append(v)
        vsum += v
        v, h = 0, high[i]
     v != 0 v 0 v = int(v + 0.5) v int(v + 0.5) int v + 0.5 v 0.5 puddle.append(v) puddle.append puddle append v vsum += v vsum v v, h = 0, high[i] v 0 h high[i] high i h = high[i] h high[i] high i print(vsum) print vsum if len(puddle) != 0:
    print(len(puddle), ' '.join(list(map(str, puddle))))
else:
    print(0) len(puddle) != 0 len(puddle) len puddle 0 print(len(puddle), ' '.join(list(map(str, puddle)))) print len(puddle) len puddle ' '.join(list(map(str, puddle))) ' '.join ' ' join list(map(str, puddle)) list map(str, puddle) map str puddle print(0) print 0 puddle, h = [], high[0] [] puddle v -= 0.5 0.5 v vsum += v v vsum mh = [0], [0], 0, 0 0 mh highest = high[::-1], highest[::-1] highest[::-1] highest high, highest = high[::-1], highest[::-1] high[::-1] high v += h - min(high[i-1], high[i]) h - min(high[i-1], high[i]) v v, h = 0, high[i] 0 v s = input() input() s h = [], high[0] high[0] h h = high[i] high[i] h h, mh = [0], [0], 0, 0 0 h highest, high, h, mh = [0], [0], 0, 0 [0] highest h = 0, high[i] high[i] h v, vsum = 0, 0 0 v high, h, mh = [0], [0], 0, 0 [0] high v = int(v + 0.5) int(v + 0.5) v vsum = 0, 0 0 vsum h = min(h, highest[i]) min(h, highest[i]) h
s = input()
highest, high, h, mh = [0], [0], 0, 0
for i in range(len(s)):
    if s[-i-1] == '\\':     h += 1
    elif s[-i-1] == "/":    h -= 1
    
    if mh < h:  mh = h
    
    high.append(h)
    highest.append(mh)

high, highest = high[::-1], highest[::-1]
puddle, h = [], high[0]
v, vsum = 0, 0
for i in range(1, len(s) + 1):
    h = min(h, highest[i])
    if high[i] < h:
        if s[i-1] != "_":
            v -= 0.5
        v += h - min(high[i-1], high[i])
    elif v != 0:
        v = int(v + 0.5)
        puddle.append(v)
        vsum += v
        v, h = 0, high[i]
    else:
        h = high[i]
        
print(vsum)
if len(puddle) != 0:
    print(len(puddle), ' '.join(list(map(str, puddle))))
else:
    print(0)
