main = do
  s <- getLine :: IO String
  print $ f s 0 0

f :: String -> Int -> Int -> Int
f []  a b = max a b
f [x] a b = if x `elem` "ATGC" then max (a+1) b else max a b
f (x:xs) a b
  | x `elem` "ATCG" = f xs (a+1) b
  | otherwise   = f xs 0 $ max a b