import scala.io.{StdIn => in}

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

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