module Main where

import Data.List
import Control.Monad
import Debug.Trace

dropTail :: String -> [String]
dropTail s = fmap (\l -> drop l s) [0..toDrop] where
    toDrop = length s - 1

dropF :: String -> [String]
dropF s = fmap (\l -> take l s) [1..len] where
    len = length s

check :: String -> Bool
check s = all (\c -> c == 'A' || c == 'C' || c == 'G' || c == 'T') s

solve :: String -> Int
solve s = case lengthList of 
        [] -> 0
        x:xs -> x
    where
        lengthList =  reverse $ sort $ map length $ filter check $ dropF s >>= dropTail


main = do
    s <- getLine
    print $ solve s

