main :: IO()
main = do
    s <- getLine
    let b = take (length s) $ cycle ['0', '1']
    let answer' = length . filter (\(x, y) -> x == y) $ zip s b
    let answer = if length b - answer' > answer' then answer' else length b - answer'
    print answer
