import qualified Data.Map.Lazy as M

main = do
  s <- getLine
  print $ solve M.empty s

solve d []
  | M.size d == 0 = 0
  | otherwise = 1
solve d (x:xs)
  | p d x = 1 + solve M.empty (x:xs)
  | otherwise = solve d' xs
  where d' = M.insertWith (+) x 1 d

p d x = M.member d x && (not . M.null $ M.filter odd d)