object Main extends App{
  import scala.io.StdIn.readLine
  
  var str = readLine
  
  def readAGCT(x:String):String = {
  	if(x.isEmpty)return ""
    else if(x.startsWith("A")){return "A" + "" + readAGCT(x.tail)}
    else if(x.startsWith("C")){return "C" + "" + readAGCT(x.tail)}
    else if(x.startsWith("G")){return "G" + "" + readAGCT(x.tail)}
    else if(x.startsWith("T")){return "T" + "" + readAGCT(x.tail)}
    else return " " + readAGCT(x.tail)
  }
  if(readAGCT(str).split(" ").isEmpty)println("0")
  else println(readAGCT(str).split(" ").map(_.length).max.toString)
}