(* 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 solve s =
  let s = s ^ "_" in
  fold_int
    (fun (acc_max, (acc, prev)) i ->
      if is_acgt_char s.[i] then
        acc_max, (acc + 1, true)
      else
        if prev then
          max acc_max acc, (0, false)
        else
          acc_max, (acc, false))
    (0, (0, false))
    (String.length s) |> fst

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