
main = do
    s <- getLine
    let x01 = solve01 s
    let x10 = solve10 s
    print $ min x01 x10

solve01 :: String -> Int
solve01 [] = 0
solve01 (x:xs) =
    let f = if (x=='0')
                then succ
                else id
    in f $ solve10 xs

solve10 :: String -> Int
solve10 [] = 0
solve10 (x:xs) =
    let f = if (x=='1')
                then succ
                else id
    in f $ solve01 xs

