import Data.List

main = do 
       t<-getLine
       putStrLn $ if (length (h t))==0 then "0" else (show (maximum (h t)))
       where f c
              |c `elem` "AGCT"='A'
              |otherwise=' '
             g xs='A'==(head xs)
             h t=map length $ filter g $ group $ map f t