let () =
  let s = read_line () in
  Printf.printf "%d\n" @@ fst @@ 
  List.fold_left (fun (acc, s) c ->
    match s, c with
    | '1' :: s, '0' | '0' :: s, '1' -> (2 + acc, s)
    | _, _ -> (acc, c :: s)) (0, []) @@
  Array.to_list @@ Array.init (String.length s) @@ String.get s

