g = input()
l = []
q = []
n = 0
for x in range(len(g)):
    if g[x] == '\\':
        if n:
            l.append(n)
            n = 0
            if q:
                q.append(-1)
        q.append(x)
    elif g[x] == '/':
        if q:
            while True:
                p = q.pop()
                if p == -1:
                    n += l.pop()
                else:
                    break
            n += x-p
    else:
        pass
if n:
    l.append(n)
for j in range(l.count(0)):
    l.remove(0)
print(sum(l))
print(len(l), *l) g = input() g input() input l = [] l [] q = [] q [] n = 0 n 0 for x in range(len(g)):
    if g[x] == '\\':
        if n:
            l.append(n)
            n = 0
            if q:
                q.append(-1)
        q.append(x)
    elif g[x] == '/':
        if q:
            while True:
                p = q.pop()
                if p == -1:
                    n += l.pop()
                else:
                    break
            n += x-p
    else:
        pass x range(len(g)) range len(g) len g if g[x] == '\\':
        if n:
            l.append(n)
            n = 0
            if q:
                q.append(-1)
        q.append(x)
    elif g[x] == '/':
        if q:
            while True:
                p = q.pop()
                if p == -1:
                    n += l.pop()
                else:
                    break
            n += x-p
    else:
        pass g[x] == '\\' g[x] g x '\\' if n:
            l.append(n)
            n = 0
            if q:
                q.append(-1)
         n l.append(n) l.append l append n n = 0 n 0 if q:
                q.append(-1)
         q q.append(-1) q.append q append -1 q.append(x) q.append q append x elif g[x] == '/':
        if q:
            while True:
                p = q.pop()
                if p == -1:
                    n += l.pop()
                else:
                    break
            n += x-p
     g[x] == '/' g[x] g x '/' if q:
            while True:
                p = q.pop()
                if p == -1:
                    n += l.pop()
                else:
                    break
            n += x-p
     q while True:
                p = q.pop()
                if p == -1:
                    n += l.pop()
                else:
                    break
             True p = q.pop() p q.pop() q.pop q pop if p == -1:
                    n += l.pop()
                else:
                    break
             p == -1 p -1 n += l.pop() n l.pop() l.pop l pop break n += x-p n x-p x p if n:
    l.append(n) n l.append(n) l.append l append n for j in range(l.count(0)):
    l.remove(0) j range(l.count(0)) range l.count(0) l.count l count 0 l.remove(0) l.remove l remove 0 print(sum(l)) print sum(l) sum l print(len(l), *l) print len(l) len l *l l l = [] [] l n = 0 0 n n += l.pop() l.pop() n n = 0 0 n p = q.pop() q.pop() p n += x-p x-p n q = [] [] q g = input() input() g
g = input()
l = []
q = []
n = 0
for x in range(len(g)):
    if g[x] == '\\':
        if n:
            l.append(n)
            n = 0
            if q:
                q.append(-1)
        q.append(x)
    elif g[x] == '/':
        if q:
            while True:
                p = q.pop()
                if p == -1:
                    n += l.pop()
                else:
                    break
            n += x-p
    else:
        pass
if n:
    l.append(n)
for j in range(l.count(0)):
    l.remove(0)
print(sum(l))
print(len(l), *l)