let () = Scanf.scanf "%s" @@ fun s ->
  let ss = Array.init (String.length s) @@ fun i -> String.get s i in
  let f = fun (maximum, prev) i -> 
    match (i = 0, ss.(i) = 'A' || ss.(i) = 'T' || ss.(i) = 'C' || ss.(i) = 'G') with
    | (true, true) -> (1, 1)
    | (true, false) -> (0, 0)
    | (false, true) -> (max maximum (prev + 1), prev + 1)
    | (false, false) -> (max maximum 0, 0) in
  let fin_pair = List.fold_left f (0, 0) @@ List.init (String.length s) Fun.id in
  Printf.printf "%d\n" @@ fst fin_pair
