main = do
  s <- map (read . \x -> [x]) <$> getLine
  putStrLn . show $ solve s

solve :: [Int] -> Int
solve s = min (calc 0 s) (calc 1 s)

calc _ [] = 0
calc k (x:xs) =
  (if k == x then 0 else 1) + (calc ((k+1) `mod` 2) xs)
