import scala.io.StdIn.readLine;
object Main {
    def main(args: Array[String]): Unit = {
        val map = readLine.split("").toList;
        val ret = areas(map);
        println(ret.sum);
        println("%d %s".format(ret.length, ret.mkString(" ")));
    }
    
    def areas(map: List[String]): List[Int] = {
        // stack1 : "\" を格納しておき、対応する "/" が出現したときにその面積を求まる
        // stack2 : 水たまりの開始位置(start)と現時点での面積(area)を格納しておく。(start, area)
        def go1(map: List[String], cnt: Int, stack1: List[Int], stack2: List[(Int, Int)]): List[Int] = {
            map match {
                case Nil => stack2.map(_._2).reverse;
                case "_" :: restMap => go1(restMap, cnt + 1, stack1, stack2);
                case "\\" :: restMap =>go1(restMap, cnt + 1, cnt :: stack1, stack2);
                case "/" :: restMap => {
                    stack1 match {
                        case Nil => go1(restMap, cnt + 1, stack1, stack2);
                        case start :: rest =>{
                            go1(restMap, cnt + 1, rest, go2(stack2, start, cnt - start));
                        }
                    }
                }
                case _ :: restMap => go1(restMap, cnt, stack1, stack2);;
            }
        }
        def go2(ret: List[(Int, Int)], start: Int, area: Int): List[(Int, Int)] = {
            ret match {
                case Nil => (start, area) :: ret;
                case (prevStart, prevArea) :: rest =>  if (start < prevStart) go2(rest, start, prevArea + area) else (start, area) :: ret;
            }
        }
        go1(map, 0, Nil, Nil);
    }
}
