module Main where

import           Control.Monad
import           Data.List
import           Data.Ord
import           Data.List.Split
import           Data.Array.IO
import qualified Data.Vector.Unboxed           as V

main :: IO ()
main = do
  (s:ss) <- getLine
  print $ min (f ss s) (1 + f ss (other s))
  where
    f [] _ = 0
    f (s:ss) p | p /= s = f ss s
               | otherwise = 1 + f ss (other p)
    other p | p == '0'  = '1'
            | otherwise = '0'
