(* O(|s|) *)
let s = read_line ()
let ans = ref max_int
let cs = [|'0'; '1'|]
let cnt1, cnt2 = ref 0, ref 0
let _ =
  String.iteri (fun i c -> if c <> cs.(i mod 2) then incr cnt1) s;
  String.iteri (fun i c -> if c = cs.(i mod 2) then incr cnt2) s;
  min !cnt1 !cnt2 |> Printf.printf "%d\n"