-- ABC124 C problem
import Control.Monad

-- sub switching function
subf :: Char -> Char
subf '0' = '1'
subf '1' = '0'

-- main processing function
abc124c :: Char -> String -> Int
abc124c c [] = 0
abc124c c (x:xs) = (if x==c then 0 else 1) + (abc124c (subf c) xs)

-- main function
main :: IO ()
main = do
  str <- getLine
  let l = length str
  let p = abc124c '0' str
  print (min (l-p) p)