(* --------------Encoder-------------- *)
(* -----function----- *)
(*
let encoder = 0
*)

(* -------test------- *)
(* ----------------------------------- *)

(* --------------Decoder-------------- *)
(* -----function----- *)
(*
let decoder ans = ""
*)

(* -------test------- *)
(* ----------------------------------- *)

(* --------------Processor-------------- *)
(* -----function----- *)
(*
let processor dat = 0
*)

(* -------test------- *)
(* ----------------------------------- *)


(* ----------------main---------------- *)
(*
let () = print_endline (decoder (processor encoder))
*)
(* ------------------------------------ *)
let rec f lst = 
        match lst with
                [] -> 0
                | first :: rest -> 
                                let frest = f rest in
                                if first = 1 then
                                        1 + frest
                                else
                                        frest
        
let () = Scanf.scanf "%1d %1d %1d" (fun a b c -> f [a; b; c])
|> Printf.printf "%d\n"
