main = do
    xs <- getLine :: IO String
    let ys = reverse xs
    print $ min  (solve 0 (head xs) (tail xs)) (solve 0 (head ys) (tail ys))

solve :: Int -> Char -> String -> Int
solve n c [] =  n
solve n c (x:xs) = if c == x then solve (n+1) ops xs else solve n x xs
    where
        ops = if c == '0' then '1' else '0'