import Control.Monad
import Data.Bool
import Data.List

readInt = readLn :: IO Int
readInts = map read . words <$> getLine :: IO [Int]
readNInts = flip replicateM readInts

main :: IO ()
main = do
  s <- getLine
  print $ maximum $ map length $ filter f $ nub $ concatMap inits $ tails s

f :: String -> Bool
f xs = null xs'
  where
    xs' = filter (\x -> x `notElem` ['A', 'C', 'G', 'T']) xs