let is_agct c = c = 'A' || c = 'G' || c = 'C' || c = 'T';;

let solve s =
  let rec find_left s i =
    if i = String.length s then i
    else if is_agct s.[i] then i
    else find_left s (i + 1) in
  let rec longest s i j res =
    if i = String.length s then res
    else if j = String.length s then max res (j - i)
    else if is_agct s.[j] then longest s i (j + 1) res
    else let beg = find_left s j in longest s beg (beg + 1) (max res (j - i)) in
  let beg = find_left s 0 in longest s beg (beg + 1) 0
;;

let () = Scanf.scanf "%s" (fun s -> (
  solve s |> print_int
))