def calc_area(from, to)
  return 1 + (to - from - 1)
end

def merge(each_area, new_area)
  sum = new_area[0]
  each_area.delete_if do |item|
    if item[1] > new_area[1] then
      sum += item[0]
      true
    else
      false
    end
  end
  each_area << [sum, new_area[1]]
end

line = gets.chomp
stack = []
index, each_area, sum_area = 0, [], 0
line.each_char do |c|
  case c
  when '\\'
    stack.push [c, index]
  when '_'
    stack.push [c, index]
  when '/'
    poped = stack.pop
    while (poped != nil && poped[0] != '\\') do 
      poped = stack.pop 
    end
    if poped != nil then
      area = calc_area(poped[1], index)
      sum_area += area 
      merge(each_area, [area, poped[1]])
    end
  end
  index += 1
end

puts sum_area
print each_area.size.to_s + " "
puts each_area.sort{|a, b| a[1] <=> b[1]}.map{|a| a[0]}.join(' ')