-- ABC124 C problem
import Control.Monad

{-
-- conversion from String to Int
toInt :: String -> Int
toInt x = read x :: Int

-- obtain [Int] from I/O
getInts :: IO [Int]
getInts = do
  x <- getLine
  let y = (map $ toInt) $ words x
  return y
-}

abc124c :: String -> Int -> Int
abc124c [] n = 0
abc124c ('0':str) n =
  case (mod n 2) of
    0 -> (abc124c str (n+1))
    1 -> 1 + (abc124c str (n+1))
abc124c ('1':str) n =
  case (mod n 2) of
    0 -> 1 + (abc124c str (n+1))
    1 -> (abc124c str (n+1))

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