import Data.List

substrings :: String -> [String]
substrings str = nub [substring a b | a <- ns, b <- ns] 
 where len = length str
       ns = [0..len]
       substring x y = take (len-x-y) $ drop x str

main = do
  s <- getLine
  let acgts = filter (\s' -> foldr (\c acc -> acc && elem c "ACGT") True s') $ substrings s
  print $ maximum $ map length acgts