s = raw_input()

St1, St2 = [], []
sumv = 0

for i in range(len(s)):
    if s[i] == '\\':
        St1.append(i)
    elif s[i] == '/' and len(St1) > 0:
        j = St1.pop()
        a = i-j
        sumv += a
        while len(St2) > 0 and St2[-1][0] > j:
            a += St2.pop()[1]

        St2.append([j, a])

St2.insert(0, [0, len(St2)])

print sumv
print ' '.join(map(lambda x: str(x[1]), St2)) s = raw_input() s raw_input() raw_input St1, St2 = [], [] St1 [] St2 [] sumv = 0 sumv 0 for i in range(len(s)):
    if s[i] == '\\':
        St1.append(i)
    elif s[i] == '/' and len(St1) > 0:
        j = St1.pop()
        a = i-j
        sumv += a
        while len(St2) > 0 and St2[-1][0] > j:
            a += St2.pop()[1]

        St2.append([j, a]) i range(len(s)) range len(s) len s if s[i] == '\\':
        St1.append(i)
    elif s[i] == '/' and len(St1) > 0:
        j = St1.pop()
        a = i-j
        sumv += a
        while len(St2) > 0 and St2[-1][0] > j:
            a += St2.pop()[1]

        St2.append([j, a]) s[i] == '\\' s[i] s i '\\' St1.append(i) St1.append St1 append i elif s[i] == '/' and len(St1) > 0:
        j = St1.pop()
        a = i-j
        sumv += a
        while len(St2) > 0 and St2[-1][0] > j:
            a += St2.pop()[1]

        St2.append([j, a]) s[i] == '/' and len(St1) > 0 s[i] == '/' s[i] s i '/' len(St1) > 0 len(St1) len St1 0 j = St1.pop() j St1.pop() St1.pop St1 pop a = i-j a i-j i j sumv += a sumv a while len(St2) > 0 and St2[-1][0] > j:
            a += St2.pop()[1]

         len(St2) > 0 and St2[-1][0] > j len(St2) > 0 len(St2) len St2 0 St2[-1][0] > j St2[-1][0] [-1] St2 -1 0 j a += St2.pop()[1] a St2.pop()[1] St2.pop() St2.pop St2 pop 1 St2.append([j, a]) St2.append St2 append [j, a] j a St2.insert(0, [0, len(St2)]) St2.insert St2 insert 0 [0, len(St2)] 0 len(St2) len St2 print print ' '.join(map(lambda x: str(x[1]), St2)) ' '.join ' ' join map(lambda x: str(x[1]), St2) map lambda x: str(x[1]) str(x[1]) str x[1] x 1 x St2 s = raw_input() raw_input() s St1, St2 = [], [] [] St1 St2 = [], [] [] St2 sumv = 0 0 sumv a = i-j i-j a sumv += a a sumv j = St1.pop() St1.pop() j a += St2.pop()[1] St2.pop()[1] a
s = raw_input()

St1, St2 = [], []
sumv = 0

for i in range(len(s)):
    if s[i] == '\\':
        St1.append(i)
    elif s[i] == '/' and len(St1) > 0:
        j = St1.pop()
        a = i-j
        sumv += a
        while len(St2) > 0 and St2[-1][0] > j:
            a += St2.pop()[1]

        St2.append([j, a])

St2.insert(0, [0, len(St2)])

print sumv
print ' '.join(map(lambda x: str(x[1]), St2))