let () =
  let s = read_line () in
  Printf.printf "%d\n" @@
  Array.fold_left (Array.fold_left (fun l s ->
    max l @@
    if
      List.exists (function
        | 'A' | 'C' | 'G' | 'T' -> false | _ -> true) @@
      Array.to_list @@
      Array.init (String.length s) (String.get s)
    then min_int
    else String.length s)) min_int @@
  Array.init (String.length s + 1) @@ fun l ->
    Array.init (String.length s - l + 1) @@ fun i ->
      String.sub s i l
