main = do
    s <- getLine
    putStrLn $ show $ solve s 0 0

solve :: String -> Int -> Int -> Int
solve [] l r = max l r
solve (x:xs) l r =
    if x `elem` "ACGT" then solve xs l (r + 1)
    else solve xs (max l r) 0