import scala.collection.mutable.ArrayBuffer

object Main extends App {
  val s = readLine
  val subsList = ArrayBuffer.empty[ArrayBuffer[String]]
  var subs = ArrayBuffer.empty[String]
  val targetSet = Set("A", "T", "G", "C")
  
  for (l <- s) {
    if (targetSet contains l.toString) {
      subs += l.toString
    } else {
      subsList += subs
      subs = ArrayBuffer.empty[String]
    }
  }

  var maxSize = 0
  for (c <- subsList) {
    maxSize = if (c.size > maxSize) c.size else maxSize
  }
  println(maxSize)
}