let s = read_line () in
let n = String.length s in
let rec fill i k acc =
    if i = n then acc else
        fill (i + 1) (1 - k) (acc + if s.[i] = '0' && k = 0 || s.[i] = '1' && k = 1 then 0 else 1)
in
min (fill 0 0 0) (fill 0 1 0) |> Printf.printf "%d\n"