let is_acgt = function 'A' | 'C' | 'G' | 'T' -> true | _ -> false
let is_acgt s =
  let l = String.length s in
  let res = ref true in
  for i = 0 to l - 1 do
    if not (is_acgt @@ String.get s i) then res := false
  done; !res

let _ =
  let s = Scanf.scanf "%s\n" (fun s -> s) in
  let l = String.length s in
  let max_n = ref 0 in
  for i = 0 to l - 1 do
    for j = 1 to l - i do
      let s' = String.sub s i j in
      if is_acgt s' then max_n := max !max_n (j)
    done
  done;
  !max_n |> print_int