
main = do
  s <- getLine
  let as = map (read . return) s :: [Int]
  let bs = zipWith (==) (cycle[0,1]) as
  print $ func bs

func :: [Bool] -> Int
func bs = if x < y then x else y
  where x = length $ filter (==True) bs
        y = length $ filter (==False) bs

