let string_count f s =
  let count = ref 0 in
  String.iter (fun c -> if f c then incr count) s;
  !count

let solve s = string_count ((=) '1') s

let _ = read_line () |> solve |> string_of_int |> print_endline