[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reads f = stdin.ReadLine().Split() |> Array.toList |> List.map f

let rec diff xs ys =
    Seq.zip xs ys
    |> Seq.fold (fun s (x, y) -> if x <> y then s + 1 else s) 0

[<EntryPoint>]
let main _ =
    let ss = (read string).ToCharArray() |> Array.toSeq
    let f x = if x = '0' then Some (x, '1') else Some (x, '0')
    min (diff ss (Seq.unfold f '0')) (diff ss (Seq.unfold f '1'))
    |> printfn "%i"
    0