(* 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

(* O(1) *)
let is_acgt_char = function
| 'A' | 'C' | 'G' | 'T' -> true
| _ -> false

(* O(|s|) *)
let solve s =
  fold_int
    (fun (acc_max, count) i ->
      if is_acgt_char s.[i] then
        max acc_max (count + 1), count + 1
      else
        acc_max, 0)
    (0, 0)
    (String.length s) |> fst

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