import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val S = sc.nextLine

  val a = S.map(Set('A', 'C', 'G', 'T').contains(_)).foldLeft((0, 0))((z, x) => if (x) (z._1 + 1, math.max(z._2, z._1 + 1)) else (0, z._2))
  println(a._2)
}
