diagram = gets.chomp.chars

upper_skip = ->{
  loop do
    a = diagram[0]
    return false if a == "\\"
    return true unless a
    diagram.shift
  end
}

downer_skip = ->(target_height) {
  height = index = 0
  until height == target_height
    height -= 1 if diagram.shift == "\\"
    index += 1
  end
  index
}

highest = ->{
  max_index = height = 0
  max_height = -Float::INFINITY 
  diagram.size.times do |j|
    case diagram[j]
    when "\\"
      height -= 1
    when "/"
      height += 1
      max_height, max_index = height, j if max_height < height
      return [0, j] if height.zero?
    end
  end
  [max_height, max_index]
}

calc_area = ->(from, to) {
  depth = area = 0
  from.upto(to) do
    case diagram.shift
    when "\\"
      area += depth + 1/2r
      depth += 1
    when "_"
      area += depth
    when "/"
      depth -= 1
      area += depth + 1/2r
    end
  end
  area.to_i
}


pools = []
loop do
  break if upper_skip.()
  height, last_index = highest.()
  if height.zero?
    pools << calc_area.(0, last_index)
  elsif height == -Float::INFINITY
    break
  else
    first_index = downer_skip.(height)
    pools << calc_area.(first_index, last_index)
  end
  break if diagram.size.zero?
end

if pools.empty?
  puts 0, 0
else
  puts pools.inject(&:+)
  puts pools.size.to_s + " " + pools.join(" ")
end
