let rec count num lst cnt =
  match lst with
  | [] -> cnt
  | head :: tail ->
    if head = num then count num tail (cnt+1) else count num tail cnt
let () =
  let list_of_string str =
    let l = String.length str in
    let rec iter i lst =
      if i >= l then lst
      else iter (i+1) ((int_of_char str.[i] - 48) :: lst) in
  iter 0 [] in
  let s = list_of_string (string_of_int (Scanf.scanf "%d\n" (fun x -> x))) in
  let count_0 = count 0 s 0 in
  let count_1 = count 1 s 0 in
  Printf.printf "%d %d %d\n" count_0 count_1 ((min count_0 count_1) * 2)