let xor a b = (a &&& ~~~b) ||| (~~~a &&& b)
let rec countR cnt n = 
  if n = 0
  then cnt
  else if n &&& 1 = 1
  then countR (cnt+1) (n >>> 1)
  else countR cnt (n >>> 1)

let S = stdin.ReadLine()
let N = int ("0b" + S)
let L = S.Length
let A1 = [0..L-1] |> List.filter (fun x -> x % 2 = 0) |> List.fold (fun a -> fun n -> a + (1 <<< n)) 0
let A2 = [0..L-1] |> List.filter (fun x -> x % 2 = 1) |> List.fold (fun a -> fun n -> a + (1 <<< n)) 0

min (countR 0 (xor A1 N)) (countR 0 (xor A2 N))
|> printfn "%d"