w = input()

h = [0]

for i in range(len(w)):
  if w[i] == "/":
    h.append(h[i]+1)
  elif w[i] == "_":
    h.append(h[i])
  else:
    h.append(h[i]-1)

L = []

lstart = []

for i in range(len(w)):
  if w[i] == "\\":
    lstart.append(i)
    L.append(0)
  elif w[i] == "/" and not lstart == []:
    j = lstart.pop()
    s = i-j
    for k in range(1, i-j):
      if L[i-k]>0:
        s += L.pop(i-k)
        L.append(0)
    L.append(s)
  else:
    L.append(0)

L = [i for i in L if i > 0]

print(sum(L))
L.insert(0,len(L))
print(" ".join(map(str, L))) w = input() w input() input h = [0] h [0] 0 for i in range(len(w)):
  if w[i] == "/":
    h.append(h[i]+1)
  elif w[i] == "_":
    h.append(h[i])
  else:
    h.append(h[i]-1) i range(len(w)) range len(w) len w if w[i] == "/":
    h.append(h[i]+1)
  elif w[i] == "_":
    h.append(h[i])
  else:
    h.append(h[i]-1) w[i] == "/" w[i] w i "/" h.append(h[i]+1) h.append h append h[i]+1 h[i] h i 1 elif w[i] == "_":
    h.append(h[i])
   w[i] == "_" w[i] w i "_" h.append(h[i]) h.append h append h[i] h i h.append(h[i]-1) h.append h append h[i]-1 h[i] h i 1 L = [] L [] lstart = [] lstart [] for i in range(len(w)):
  if w[i] == "\\":
    lstart.append(i)
    L.append(0)
  elif w[i] == "/" and not lstart == []:
    j = lstart.pop()
    s = i-j
    for k in range(1, i-j):
      if L[i-k]>0:
        s += L.pop(i-k)
        L.append(0)
    L.append(s)
  else:
    L.append(0) i range(len(w)) range len(w) len w if w[i] == "\\":
    lstart.append(i)
    L.append(0)
  elif w[i] == "/" and not lstart == []:
    j = lstart.pop()
    s = i-j
    for k in range(1, i-j):
      if L[i-k]>0:
        s += L.pop(i-k)
        L.append(0)
    L.append(s)
  else:
    L.append(0) w[i] == "\\" w[i] w i "\\" lstart.append(i) lstart.append lstart append i L.append(0) L.append L append 0 elif w[i] == "/" and not lstart == []:
    j = lstart.pop()
    s = i-j
    for k in range(1, i-j):
      if L[i-k]>0:
        s += L.pop(i-k)
        L.append(0)
    L.append(s)
   w[i] == "/" and not lstart == [] w[i] == "/" w[i] w i "/" not lstart == [] lstart == [] lstart [] j = lstart.pop() j lstart.pop() lstart.pop lstart pop s = i-j s i-j i j for k in range(1, i-j):
      if L[i-k]>0:
        s += L.pop(i-k)
        L.append(0)
     k range(1, i-j) range 1 i-j i j if L[i-k]>0:
        s += L.pop(i-k)
        L.append(0)
     L[i-k]>0 L[i-k] L i-k i k 0 s += L.pop(i-k) s L.pop(i-k) L.pop L pop i-k i k L.append(0) L.append L append 0 L.append(s) L.append L append s L.append(0) L.append L append 0 i for i in L if i > 0 for i in L if i > 0 i L i > 0 i 0 if i > 0 i L = [i for i in L if i > 0] L [i for i in L if i > 0] print(sum(L)) print sum(L) sum L L.insert(0,len(L)) L.insert L insert 0 len(L) len L print(" ".join(map(str, L))) print " ".join(map(str, L)) " ".join " " join map(str, L) map str L L = [i for i in L if i > 0] [i for i in L if i > 0] L h = [0] [0] h L = [] [] L lstart = [] [] lstart s = i-j i-j s j = lstart.pop() lstart.pop() j s += L.pop(i-k) L.pop(i-k) s w = input() input() w
w = input()

h = [0]

for i in range(len(w)):
  if w[i] == "/":
    h.append(h[i]+1)
  elif w[i] == "_":
    h.append(h[i])
  else:
    h.append(h[i]-1)

L = []

lstart = []

for i in range(len(w)):
  if w[i] == "\\":
    lstart.append(i)
    L.append(0)
  elif w[i] == "/" and not lstart == []:
    j = lstart.pop()
    s = i-j
    for k in range(1, i-j):
      if L[i-k]>0:
        s += L.pop(i-k)
        L.append(0)
    L.append(s)
  else:
    L.append(0)

L = [i for i in L if i > 0]

print(sum(L))
L.insert(0,len(L))
print(" ".join(map(str, L)))
