import qualified Data.ByteString.Char8 as BC

main = do
  input <-  BC.getLine
  let p = last . map (length . BC.unpack) . BC.group . BC.sort $ input
      num = length . BC.unpack $ input
  print $ (div num 2) - p

