import Control.Monad
import Control.Applicative
import Data.List


-- [a] <- map read . words <$> getLine => [1] -> a == 1
-- 1
-- a <- readLn
-- 1 2 3
-- lst <- map read . words <$> getLine => [1, 2, 3]
-- 1 2 3
-- [l, m, n] <- map read . words <$. getLine :: IO [Int] => [1, 2, 3]
-- 'a'
-- c <- getChar => c == 'a'
--
-- slst <- replicateM h getLine

-- getBysplit = map read . words <$> getLine

main :: IO()
main = do
  s <- getLine
  let n = length s
  let lst1 = map (\x -> if x `mod` 2 == 0 then '1' else '0') [1..n]
  let lst2 = map (\x -> if x `mod` 2 == 0 then '0' else '1') [1..n]
  print $ check s lst1 lst2 (0, 0)

check :: String -> String -> String -> (Int, Int) -> Int
check [] [] [] (a, b) = min a b
check (x:xs) (y:ys) (z:zs) (a, b) = check xs ys zs (ay, bz)
    where
      ay = if x == y then a else a+1
      bz = if x == z then b else b+1
