a, b, d = [], [], []
amount = 0
for i, x in enumerate(input()):
    if x == '\\':
        a += [i]
    elif x == '/' and a:
        j = a.pop()
        pool = i - j
        amount += pool
        while b and b[-1] > j:
            pool += d.pop()
            b.pop()
        b.append(j)
        d.append(pool)
print(amount)
print(len(b), *d) a, b, d = [], [], [] a [] b [] d [] amount = 0 amount 0 for i, x in enumerate(input()):
    if x == '\\':
        a += [i]
    elif x == '/' and a:
        j = a.pop()
        pool = i - j
        amount += pool
        while b and b[-1] > j:
            pool += d.pop()
            b.pop()
        b.append(j)
        d.append(pool) i x enumerate(input()) enumerate input() input if x == '\\':
        a += [i]
    elif x == '/' and a:
        j = a.pop()
        pool = i - j
        amount += pool
        while b and b[-1] > j:
            pool += d.pop()
            b.pop()
        b.append(j)
        d.append(pool) x == '\\' x '\\' a += [i] a [i] i elif x == '/' and a:
        j = a.pop()
        pool = i - j
        amount += pool
        while b and b[-1] > j:
            pool += d.pop()
            b.pop()
        b.append(j)
        d.append(pool) x == '/' and a x == '/' x '/' a j = a.pop() j a.pop() a.pop a pop pool = i - j pool i - j i j amount += pool amount pool while b and b[-1] > j:
            pool += d.pop()
            b.pop()
         b and b[-1] > j b b[-1] > j b[-1] b -1 j pool += d.pop() pool d.pop() d.pop d pop b.pop() b.pop b pop b.append(j) b.append b append j d.append(pool) d.append d append pool print(amount) print amount print(len(b), *d) print len(b) len b *d d j = a.pop() a.pop() j amount += pool pool amount amount = 0 0 amount d = [], [], [] [] d a, b, d = [], [], [] [] a b, d = [], [], [] [] b pool += d.pop() d.pop() pool pool = i - j i - j pool a += [i] [i] a
a, b, d = [], [], []
amount = 0
for i, x in enumerate(input()):
    if x == '\\':
        a += [i]
    elif x == '/' and a:
        j = a.pop()
        pool = i - j
        amount += pool
        while b and b[-1] > j:
            pool += d.pop()
            b.pop()
        b.append(j)
        d.append(pool)
print(amount)
print(len(b), *d)
