(* O(n) *)
let rec fold_btw f a i n = if i >= n then a else fold_btw f (f a i) (i + 1) n
let fold_int f a n = fold_btw f a 0 n

let is_acgt_char = function
| 'A' | 'C' | 'G' | 'T' -> true
| _ -> false

(* O(|s|) *)
let acgt_length s i =
  let n = String.length s in
  let rec count acc j =
    if j >= n || not (is_acgt_char s.[j]) then
      acc
    else
      count (acc + 1) (j + 1)
  in
    count 0 i

(* O(|s|^2) *)
let solve s = fold_int (fun acc i -> max acc (acgt_length s i)) 0 (String.length s)

let _ = read_line () |> solve |> string_of_int |> print_endline