let c = [|'0'; '1'|]
let () =
  Scanf.scanf "%s" @@ fun s ->
  let n = String.length s in
  let s = Array.init n (fun i -> i, s.[i]) in
  Array.fold_left (fun (p, q) (i, x) -> if x = c.(i mod 2) then (p+1, q) else (p, q+1)) (0, 0) s
  |> fun (p, q) -> Printf.printf "%d\n" (min p q)

