[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reads f = stdin.ReadLine().Split() |> Array.toList |> List.map f

let conv i j xs =
    List.skip i xs
    |> List.rev
    |> List.skip j

let check xs =
    List.forall (fun c -> List.contains c ['A';'C';'G';'T']) xs

[<EntryPoint>]
let main argv =
    let s = read id
    let n = String.length s
    let ss = s.ToCharArray() |> Array.toList
    seq {
        for i = 0 to n do
            for j = 0 to n do
                if i + j <= n then
                    let cs = conv i j ss
                    if check cs then yield List.length cs
    }
    |> Seq.max
    |> printfn "%i"
    0