import Control.Arrow
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B

main :: IO ()
main = getLine >>= print . solve

solve :: String -> Int
solve ss = min a b
    where
        a = check True bs
        b = check False bs
        bs = map (== '0') ss

        check f = fst . foldl' ff (0, f)
            where
                ff (acc, flag) x
                    | flag == x = (acc, not flag)
                    | otherwise = (acc + 1, not flag)

readLine :: IO [Int]
readLine = unfoldr (fmap (second (maybe B.empty snd . B.uncons)) . B.readInt) <$> B.getLine

readContents :: Int -> IO [[Int]]
readContents = flip replicateM readLine