{-# LANGUAGE BangPatterns #-}

import Control.Monad
import Data.List
import Data.Bits
import Debug.Trace
import Data.Maybe
import qualified Data.ByteString.Char8 as C

main :: IO ()
main = do
  s <- C.getLine
  print $ solve s

solve s = min (bo + we) (be + wo)
  where
    n = C.length s
    evens = (n `div` 2)
    odds = (evens + n `mod` 2)
    countx cnt i c = if i >= n 
      then cnt
      else if C.index s i == c
        then countx (cnt + 1) (i + 2) c
        else countx cnt (i + 2) c
    bo = countx 0 0 '0'
    be = countx 0 1 '0'
    wo = odds - bo
    we = evens - be

-- 以下ライブラリ

readInts :: IO [Int]
readInts = map (fst . fromJust . C.readInt) . C.words <$> C.getLine

readNInts :: Int -> IO [[Int]]
readNInts = flip replicateM readInts

readIntegers :: IO [Integer]
readIntegers = map (fst . fromJust . C.readInteger) . C.words <$> C.getLine

readNIntegers :: Int -> IO [[Integer]]
readNIntegers = flip replicateM readIntegers

getNLns :: Int -> IO [String]
getNLns = flip replicateM getLine