let s = read_line ()
let ans, cnt = ref 0, ref 0
let f c = if String.contains "ACGT" c then incr cnt else (ans := max !ans !cnt; cnt := 0)
let _ = String.iter f s; Printf.printf "%d\n" @@ max !ans !cnt