open Printf
open Scanf

let () =
  let s = scanf "%s " (fun x -> x) in
  let ss = String.length s in
  let rec count c i =
    if i = ss then c
    else if s.[i] = '1' then count (c + 1) (i + 1)
    else count c (i + 1) in
  count 0 0 |> printf "%d\n"
