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

(* O(|s|) *)
let solve s =
  let s2 = String.init (String.length s) (fun i -> if is_acgt_char s.[i] then '1' else '0') in
  Str.split (Str.regexp "0") s2 |> List.map String.length |> List.fold_left max 0

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