import scala.io.StdIn
object Main extends App {
  
  
  var index = -1
  val inp = StdIn.readLine().trim
  val result = inp.foldLeft(List.empty[Int], List.empty[(Int, Int)], 0){  (acc, e) =>
    var tempAll  = acc._1
    var tempEach = acc._2
    var allmenseki = acc._3
    //println(tempAll)
    //println(tempEach)

    index += 1
    if(e == '\\') {
      tempAll = index :: tempAll  
    } else if(e == '/' && tempAll.length > 0){
      var j = tempAll.head
      allmenseki += index - j
      tempAll = if(tempAll.length == 1) Nil else tempAll.tail
      var a = index - j
      while(tempEach.size > 0 && tempEach.head._1 > j){
        a += tempEach.head._2
        tempEach = tempEach.tail
      }
      tempEach = (j, a) :: tempEach
    }
    
    (tempAll, tempEach, allmenseki)
  }
  
  println(result._3)
  println(result._2.size + " " + result._2.reverse.map(e => e._2).mkString(" "))

  
}

