main :: IO ()
main = do
  xs <- getLine
  let n = length xs
  if n == 0
    then print 0
    else do
      let s0 = '0' : '1' : s0
          s1 = '1' : '0' : s1
          n0 = length $ filter (\(a, b) -> a /= b) $ zip xs s0
          n1 = length $ filter (\(a, b) -> a /= b) $ zip xs s1
      print $ min n0 n1