let S = stdin.ReadLine()

let seq0 = S |> Seq.map (fun x -> (int x) - (int '0'))
let seq1 = Seq.initInfinite (fun x -> (x % 2)) // 01010101010
let seq2 = seq1 |> Seq.skip 1 //101010101

Seq.zip3 seq0 seq1 seq2
|> Seq.fold (fun (cnt1,cnt2) -> fun (x,a,b) -> 
    if x = a then (cnt1, cnt2+1) else (cnt1+1, cnt2)) (0,0)
|> fun (a, b) -> min a b
|> printfn "%d"