# -*- coding: utf-8 -*-

S = input()

# 各地点の高さを求める
v = {'\\': -1, '_': 0, '/': 1}
h = 0  # 左端の高さ
H = [h]
for s in S:
    h += v[s]
    H.append(h)

# 右部分列の最大値
R = [0] * len(H)
R[-1] = -float('inf')
for i in range(len(R) - 2, -1, -1):
    R[i] = max(R[i+1], H[i+1])

A = []
i = 0
while True:
    # 左端の左斜面をスキップ
    while i < len(S) and S[i] != '\\':
        i += 1

    # 右側の縁と同じ高さまでスキップ
    while i < len(S) and (H[i] > R[i] or S[i] == '_'):
        i += 1

    if i >= len(S):
        break

    # 水たまりの面積を求める
    h = H[i]  # 左端の高さ
    a = 0     # 面積
    while i < len(S):
        a += (h - H[i]) + (H[i] - H[i+1])/2
        i += 1
        if H[i] == h: break
    A.append(int(a))

print(sum(A))
print(' '.join(map(str, [len(A)] + A))) S = input() S input() input v = {'\\': -1, '_': 0, '/': 1} v {'\\': -1, '_': 0, '/': 1} '\\' '\\' -1 '_' '_' 0 '/' '/' 1 h = 0 h 0 H = [h] H [h] h for s in S:
    h += v[s]
    H.append(h)

# 右部分列の最大値 s S h += v[s] h v[s] v s H.append(h) H.append H append h R = [0] * len(H) R [0] * len(H) [0] 0 len(H) len H R[-1] = -float('inf') R[-1] R -1 -float('inf') float('inf') float 'inf' for i in range(len(R) - 2, -1, -1):
    R[i] = max(R[i+1], H[i+1]) i range(len(R) - 2, -1, -1) range len(R) - 2 len(R) len R 2 -1 -1 R[i] = max(R[i+1], H[i+1]) R[i] R i max(R[i+1], H[i+1]) max R[i+1] R i+1 i 1 H[i+1] H i+1 i 1 A = [] A [] i = 0 i 0 while True:
    # 左端の左斜面をスキップ
    while i < len(S) and S[i] != '\\':
        i += 1

    # 右側の縁と同じ高さまでスキップ
    while i < len(S) and (H[i] > R[i] or S[i] == '_'):
        i += 1

    if i >= len(S):
        break

    # 水たまりの面積を求める
    h = H[i]  # 左端の高さ
    a = 0     # 面積
    while i < len(S):
        a += (h - H[i]) + (H[i] - H[i+1])/2
        i += 1
        if H[i] == h: break
    A.append(int(a)) True while i < len(S) and S[i] != '\\':
        i += 1

    # 右側の縁と同じ高さまでスキップ
     i < len(S) and S[i] != '\\' i < len(S) i len(S) len S S[i] != '\\' S[i] S i '\\' i += 1 i 1 while i < len(S) and (H[i] > R[i] or S[i] == '_'):
        i += 1

     i < len(S) and (H[i] > R[i] or S[i] == '_') i < len(S) i len(S) len S H[i] > R[i] or S[i] == '_' H[i] > R[i] H[i] H i R[i] R i S[i] == '_' S[i] S i '_' i += 1 i 1 if i >= len(S):
        break

    # 水たまりの面積を求める
     i >= len(S) i len(S) len S break h = H[i] h H[i] H i a = 0 a 0 while i < len(S):
        a += (h - H[i]) + (H[i] - H[i+1])/2
        i += 1
        if H[i] == h: break
     i < len(S) i len(S) len S a += (h - H[i]) + (H[i] - H[i+1])/2 a (h - H[i]) + (H[i] - H[i+1])/2 h - H[i] h H[i] H i (H[i] - H[i+1])/2 H[i] - H[i+1] H[i] H i H[i+1] H i+1 i 1 2 i += 1 i 1 if H[i] == h: break
     H[i] == h H[i] H i h A.append(int(a)) A.append A append int(a) int a print(sum(A)) print sum(A) sum A print(' '.join(map(str, [len(A)] + A))) print ' '.join(map(str, [len(A)] + A)) ' '.join ' ' join map(str, [len(A)] + A) map str [len(A)] + A [len(A)] len(A) len A A A = [] [] A a = 0 0 a h += v[s] v[s] h i += 1 1 i a += (h - H[i]) + (H[i] - H[i+1])/2 (h - H[i]) + (H[i] - H[i+1])/2 a i += 1 1 i R = [0] * len(H) [0] * len(H) R v = {'\\': -1, '_': 0, '/': 1} {'\\': -1, '_': 0, '/': 1} v h = 0 0 h H = [h] [h] H i = 0 0 i i += 1 1 i h = H[i] H[i] h S = input() input() S
# -*- coding: utf-8 -*-

S = input()

# 各地点の高さを求める
v = {'\\': -1, '_': 0, '/': 1}
h = 0  # 左端の高さ
H = [h]
for s in S:
    h += v[s]
    H.append(h)

# 右部分列の最大値
R = [0] * len(H)
R[-1] = -float('inf')
for i in range(len(R) - 2, -1, -1):
    R[i] = max(R[i+1], H[i+1])

A = []
i = 0
while True:
    # 左端の左斜面をスキップ
    while i < len(S) and S[i] != '\\':
        i += 1

    # 右側の縁と同じ高さまでスキップ
    while i < len(S) and (H[i] > R[i] or S[i] == '_'):
        i += 1

    if i >= len(S):
        break

    # 水たまりの面積を求める
    h = H[i]  # 左端の高さ
    a = 0     # 面積
    while i < len(S):
        a += (h - H[i]) + (H[i] - H[i+1])/2
        i += 1
        if H[i] == h: break
    A.append(int(a))

print(sum(A))
print(' '.join(map(str, [len(A)] + A)))
