let s = read_line () in
let n = String.length s in
let rec loop i cur acc =
    if i = n then acc else
        let cur = if String.contains "ATGC" s.[i] then cur + 1 else 0 in
        let acc = max acc cur in
        loop (i + 1) cur acc
in
loop 0 0 0 |> Printf.printf "%d\n"