type ABC(stream:System.IO.TextReader) =
  member this.Scan1 f = stream.ReadLine() |> f
  member this.Scan2 f = stream.ReadLine().Split() |> Array.map f |> (fun a -> (a.[0], a.[1]))
  member this.Scan3 f = stream.ReadLine().Split() |> Array.map f |> (fun a -> (a.[0], a.[1], a.[2]))
  member this.Scan4 f = stream.ReadLine().Split() |> Array.map f |> (fun a -> (a.[0], a.[1], a.[2], a.[3]))
  member this.ScanVecH f = stream.ReadLine().Split() |> Array.map f
  member this.ScanVecV n f = [| for i in 1..n -> stream.ReadLine() |> f |]
  member this.ScanMatrix n f  = [ for i in 1..n do yield stream.ReadLine().Split() |> Array.map f ]
  member this.ScanCharMatrix n = [ for i in 1..n -> stream.ReadLine().ToCharArray() ]
  member this.Close () = stream.Close()

let util = ABC(stdin)

let s = util.Scan1 string
let L = Seq.length s
let isACGT = String.forall (fun x -> List.contains x ['A';'C';'G';'T'])

seq {
  yield 0; // for empty
  for i in 0..L-1 do
  for j in i..L-1 do
    if isACGT s.[i..j]
      then yield j - i + 1
}
|> Seq.max
|> printfn "%d"
