let to_list str =
  let rec doit i acc =
    if i < 0 then acc
    else doit (i - 1) (String.get str i :: acc)
  in
  doit (String.length str - 1) []

let calc_area lst =
  let rec doit i idxs acc = function
    | [] -> acc
    | '_' :: tl -> doit (i + 1) idxs acc tl
    | '\\' :: tl -> doit (i + 1) (i :: idxs) acc tl
    | '/' :: tl -> begin
        match idxs with
        | [] -> doit (i + 1) idxs acc tl
        | j :: js -> doit (i + 1) js (((j, i), i - j) :: acc) tl
      end
    | _ -> exit 1
  in
  doit 0 [] [] lst

let integrale lst =
  let rec doit acc = function
    | [] -> acc
    | [e] -> e :: acc
    | (((j1, i1), area1) as xs) :: ((((j2, i2), area2) :: tl) as ys) ->
        if j1 < j2 && i1 > i2 then doit acc (((j1, i1), area1 + area2) :: tl)
        else doit (xs :: acc) ys
  in
  doit [] lst

let () =
  let areas = integrale (calc_area (to_list (read_line ()))) in
  Printf.printf "%d\n" (List.fold_left (fun acc (_, n) -> acc + n) 0 areas);
  Printf.printf "%d" (List.length areas);
  List.iter (fun (_, n) -> Printf.printf " %d" n) areas;
  print_newline ()