open List

let println str = print_string @@ str ^ "\n"

let () =
  let s = read_line () in
    map String.length @@ String.split_on_char '0' s
      |> fold_left (fun acc next -> acc + next) 0
      |> string_of_int
      |> println
