(* O(n) *)
let fold_int f a n =
  let rec fold f a i n =
    if i >= n then
      a
    else
      fold f (f a i) (i + 1) n
  in
    fold f a 0 n

(* O(n) (n = |s|) *)
let solve s =
  let count1, count2 = fold_int
    (fun (count1, count2) i ->
      let r = i mod 2 in
      if s.[i] = (string_of_int r).[0] then
        count1, count2 + 1
      else
        count1 + 1, count2)
    (0, 0)
    (String.length s)
  in
    min count1 count2

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