import Data.Maybe
import Data.List

main = do 
 a <- getLine
 let arr = [[c]|c<-a]
 let maxi =  maximum.map length. groupBy (\x y-> f x && f y ) $arr 
 if maxi == 1 then 
  if (length .catMaybes $
  [findIndex ("A"==) arr,findIndex("C"==) arr,findIndex ("T"==) arr,
  findIndex ("G"==) arr] )>= 1 then
  print 1 else print 0
 else  print maxi
 
 
f :: String -> Bool
f x =  x=="A" || x=="C" ||x=="G" ||x=="T"