let analysis (area:string) =
  let len = String.length area in
  let stack = Stack.create () in
  let rec loop acc = function
      i when i = len -> acc
    | i ->
      match area.[i] with
      | '\\' -> Stack.push i stack; loop acc (i+1)
      | '/' -> loop
                 (match Stack.length stack with
                    0 -> acc
                  | _ -> let j = Stack.pop stack in
                    (((j,i),i-j)::acc))
                 (i+1)
      | _ -> loop acc (i+1)
  in loop [] 0

let summarize lst =
  let rec loop acc cnt sum = function
      []  -> acc,cnt,sum
    | [x] -> x::acc,cnt+1,sum+(snd x)
    | ((s1,e1),v1)::((s2,e2),v2)::r when s1 < s2 && e1 > e2 ->
      loop acc cnt sum (((s1,e1), v1+v2)::r)
    | (_,v) as a::(b::r as rest) -> loop (a::acc) (cnt+1) (sum+v) rest
  in loop [] 0 0 lst

let () =
  let line = read_line () in
  let part,cnt,sum = analysis line |> summarize in
  Printf.printf "%d\n%d" sum cnt;
  List.iter (fun (_,v) -> Printf.printf " %d" v) part;
  print_newline ()