arr = gets.chomp.tr("/_\\","210").split("").map(&:to_i)

height = []
i = 0
height[0] = 0
arr.each{|j|
  i += 1
  height[i] = height[i-1] + j - 1
}

lake = []
tmp = height.clone
x0 = 0
loop do
  break if arr[x0] == 0
  break if tmp.size == 0
  tmp.shift
  x0 += 1
end
loop do
  break if tmp.size == 0
  h = tmp.shift
  x1 = tmp.index(h)
  if x1 then
    area = 0
    for i in x0..x0+x1
      #      printf "%d %d %d\n", i, height[i], arr[i]
      area += h - height[i]
      area += 0.5 if arr[i] == "0"
      area -= 0.5 if arr[i] == "2"
    end
    if area.to_i > 0 then
      lake.push(area.to_i)
    end
    tmp = tmp[x1...tmp.size]
    x0 += x1+1
    loop do
      break if arr[x0] == 0
      break if tmp.size == 0
      h = tmp.shift
      x0 += 1
    end
    # p x0
  else
    x0 += 1
  end
end

puts lake.inject(&:+)
printf "%d %s\n", lake.size, lake.join(" ")