import Data.List

change [] n = []
change (d:dx) n = 
    if isInfixOf [d] "ATCG" then 
        [n] ++ change dx (n + 1)
    else 
        [0] ++ change dx 1

solve s = maximum (change s 1)

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