let _ =
  let s = Scanf.scanf "%s\n" (fun s -> s) in
  let l = String.length s in
  let resa, resb = ref 0, ref 0 in
  let flaga, flagb = ref 0, ref 1 in
  let ia = int_of_char '0' in
  for i = 0 to l - 1 do
    let d = (String.get s i |> int_of_char) - ia in
    if d <> !flaga then resa := !resa + 1;
    if d <> !flagb then resb := !resb + 1;
    flaga := 1 - !flaga;
    flagb := 1 - !flagb;
  done;
  min !resa !resb |> print_int
