open Scanf
open Printf

let s = sscanf (read_line ()) "%s" (fun x -> x);;
let ans = ref 0;;
String.iteri (fun i c ->
  if (i mod 2 = 0) then
    if (c = '0') then ans := !ans + 1 else ()
  else
    if (c = '1') then ans := !ans + 1 else ()
) s;;
printf "%d\n" (min !ans ((String.length s) - !ans))
