import Data.List

main :: IO ()
main = do
  s <- getLine
  print $ ans s

ans :: String -> Int
ans s = length . last . sortBy (\a b -> compare (length a) (length b)) . map (takeWhile (`elem` ['A','T','G','C'])) $ tails s