main = do
    s <- getLine
    print $ solve s 0 0

solve :: String -> Int -> Int -> Int
solve [] mx ac = mx
solve (x:xs) mx ac
    | isATGC x && mx<=ac = solve xs (mx+1) (ac+1)
    | isATGC x  = solve xs mx (ac+1)
    | otherwise = solve xs mx 0

isATGC :: Char -> Bool
isATGC c = c=='A' || c=='T' || c=='G' || c=='C'