import Data.Char(digitToInt)
main = do
  input <- getLine
  let
    func str col ret
      | str == []                    = ret
      | digitToInt (head str) == col = func (tail str) (1-col) ret
      | otherwise                    = func (tail str) (1-col) (ret+1)
    ans_ = func input 0 0
    len = length input
    ans = min ans_ (len-ans_)
    in
      putStrLn $ show ans
