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

let calc_area lst =
  let doit (i, idxs, acc) = function
    | '_' -> (i + 1, idxs, acc)
    | '\\' -> (i + 1, i :: idxs, acc)
    | _ ->
      match idxs with
      | [] -> (i + 1, idxs, acc)
      | j :: js -> (i + 1, js, ((j, i), i - j) :: acc) in
  List.fold_left doit (0, [], []) lst
  |> fun (_, _, t) -> t

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 ()