main :: IO ()
main = do
  bs <- getLine
  print $ ans (nannko bs)

ans :: [Int] -> Int
ans [a,b,c,d] = min (a+d) (b+c)

--ki0,guu0,ki1,guu1
nannko :: String -> [Int]
nannko bs = tail $ foldl func [0,0,0,0,0] bs
  where
   func [n,a,b,c,d] k
    | n == 0 && k == '0' = [1,a+1,b,c,d]
    | n == 0 && k == '1' = [1,a,b,c+1,d]
    | n == 1 && k == '0' = [0,a,b+1,c,d]
    | n == 1 && k == '1' = [0,a,b,c,d+1]