S = raw_input()
S1, S2 = [], []

ans = pool = 0
for i in xrange(len(S)):
    if S[i] == "/" and len(S1) > 0:
        j = S1.pop()
        ans += i - j
        a = i - j
        while (len(S2) > 0 and S2[-1][0] > j):
            a += S2.pop()[1]
        S2.append([j, a])
    if S[i] == "\\":
        S1.append(i)
print ans
if len(S2) > 0:
    print len(S2), " ".join(map(str, [a for j, a in S2]))
else:
    print 0 S = raw_input() S raw_input() raw_input S1, S2 = [], [] S1 [] S2 [] ans = pool = 0 ans 0 = pool = 0 pool 0 for i in xrange(len(S)):
    if S[i] == "/" and len(S1) > 0:
        j = S1.pop()
        ans += i - j
        a = i - j
        while (len(S2) > 0 and S2[-1][0] > j):
            a += S2.pop()[1]
        S2.append([j, a])
    if S[i] == "\\":
        S1.append(i) i xrange(len(S)) xrange len(S) len S if S[i] == "/" and len(S1) > 0:
        j = S1.pop()
        ans += i - j
        a = i - j
        while (len(S2) > 0 and S2[-1][0] > j):
            a += S2.pop()[1]
        S2.append([j, a])
     S[i] == "/" and len(S1) > 0 S[i] == "/" S[i] S i "/" len(S1) > 0 len(S1) len S1 0 j = S1.pop() j S1.pop() S1.pop S1 pop ans += i - j ans i - j i j a = i - j a i - j i j while (len(S2) > 0 and S2[-1][0] > j):
            a += S2.pop()[1]
         len(S2) > 0 and S2[-1][0] > j len(S2) > 0 len(S2) len S2 0 S2[-1][0] > j S2[-1][0] [-1] S2 -1 0 j a += S2.pop()[1] a S2.pop()[1] S2.pop() S2.pop S2 pop 1 S2.append([j, a]) S2.append S2 append [j, a] j a if S[i] == "\\":
        S1.append(i) S[i] == "\\" S[i] S i "\\" S1.append(i) S1.append S1 append i print if len(S2) > 0:
    print len(S2), " ".join(map(str, [a for j, a in S2]))
else:
    print 0 len(S2) > 0 len(S2) len S2 0 print a for j, a in S2 for j, a in S2 j a S2 for j, a in S2 a len(S2) len S2 " ".join(map(str, [a for j, a in S2])) " ".join " " join map(str, [a for j, a in S2]) map str [a for j, a in S2] print j = S1.pop() S1.pop() j a += S2.pop()[1] S2.pop()[1] a a = i - j i - j a ans += i - j i - j ans S2 = [], [] [] S2 S = raw_input() raw_input() S ans = pool = 0 0 ans pool = 0 0 pool S1, S2 = [], [] [] S1
S = raw_input()
S1, S2 = [], []

ans = pool = 0
for i in xrange(len(S)):
    if S[i] == "/" and len(S1) > 0:
        j = S1.pop()
        ans += i - j
        a = i - j
        while (len(S2) > 0 and S2[-1][0] > j):
            a += S2.pop()[1]
        S2.append([j, a])
    if S[i] == "\\":
        S1.append(i)
print ans
if len(S2) > 0:
    print len(S2), " ".join(map(str, [a for j, a in S2]))
else:
    print 0