solve :: Char -> String -> Int
solve _ [] = 0
solve curr (s:ss)
  | curr == s = solve next ss
  | otherwise = 1 + solve next ss
    where next = if curr == '0' then '1' else '0'

main :: IO ()
main = do
  s <- getLine
  let a = solve '0' s
  let b = solve '1' s
  print $ min a b