main = do
  s <- getLine
  let sl = length s
  let zero = take sl $ cycle ['0','1']
  let one = take sl $ cycle ['1','0']
  print $ min (sum (zipWith f s zero)) (sum (zipWith f s one))

f x y
  | x == y = 0
  | otherwise = 1
