downs, ponds = [], []
for i, s in enumerate(input()):
  if s == "\\":
    downs.append(i)
  elif s == "/" and downs:
    i_down = downs.pop()
    area = i - i_down
    while ponds and ponds[-1][0] > i_down:
      area += ponds.pop()[1]
    ponds.append([i_down, area])
print(sum(p[1] for p in ponds))
print(len(ponds), *(p[1] for p in ponds)) downs, ponds = [], [] downs [] ponds [] for i, s in enumerate(input()):
  if s == "\\":
    downs.append(i)
  elif s == "/" and downs:
    i_down = downs.pop()
    area = i - i_down
    while ponds and ponds[-1][0] > i_down:
      area += ponds.pop()[1]
    ponds.append([i_down, area]) i s enumerate(input()) enumerate input() input if s == "\\":
    downs.append(i)
  elif s == "/" and downs:
    i_down = downs.pop()
    area = i - i_down
    while ponds and ponds[-1][0] > i_down:
      area += ponds.pop()[1]
    ponds.append([i_down, area]) s == "\\" s "\\" downs.append(i) downs.append downs append i elif s == "/" and downs:
    i_down = downs.pop()
    area = i - i_down
    while ponds and ponds[-1][0] > i_down:
      area += ponds.pop()[1]
    ponds.append([i_down, area]) s == "/" and downs s == "/" s "/" downs i_down = downs.pop() i_down downs.pop() downs.pop downs pop area = i - i_down area i - i_down i i_down while ponds and ponds[-1][0] > i_down:
      area += ponds.pop()[1]
     ponds and ponds[-1][0] > i_down ponds ponds[-1][0] > i_down ponds[-1][0] [-1] ponds -1 0 i_down area += ponds.pop()[1] area ponds.pop()[1] ponds.pop() ponds.pop ponds pop 1 ponds.append([i_down, area]) ponds.append ponds append [i_down, area] i_down area print(sum(p[1] for p in ponds)) print sum(p[1] for p in ponds) sum p[1] p 1 p[1] for p in ponds for p in ponds p ponds for p in ponds p[1] p 1 print(len(ponds), *(p[1] for p in ponds)) print len(ponds) len ponds *(p[1] for p in ponds) (p[1] for p in ponds) area += ponds.pop()[1] ponds.pop()[1] area area = i - i_down i - i_down area downs, ponds = [], [] [] downs i_down = downs.pop() downs.pop() i_down ponds = [], [] [] ponds
downs, ponds = [], []
for i, s in enumerate(input()):
  if s == "\\":
    downs.append(i)
  elif s == "/" and downs:
    i_down = downs.pop()
    area = i - i_down
    while ponds and ponds[-1][0] > i_down:
      area += ponds.pop()[1]
    ponds.append([i_down, area])
print(sum(p[1] for p in ponds))
print(len(ponds), *(p[1] for p in ponds))
