import scala.io.{StdIn => in}

object Main extends App {
  val tar = "ACGT".toCharArray

  val s = in.readLine
  val ans = {
    var res = 0
    for {
      i <- 0 until s.size
      j <- i+1 to s.size
    } {
      val ss = s.substring(i,j)
      if(ss.forall(ch => tar.exists(_ == ch))) {
        var n = ss.size
        debug(ss)

        if(n > res) res = n
      }
    }
    res
  }
  println(ans)

  def debug(any:Any*):Unit = {
    if(this.getClass.toString == "class Main$") return
    println(any.mkString(" "))
  }
}