object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)

    val S = scala.io.StdIn.readLine()

    def isACGT(c: Char): Boolean =
      c match {
        case 'A' | 'C' | 'G' | 'T' => true
        case _ => false
      }

    var count = 0
    var max = 0
    S.foreach { c =>
      if (isACGT(c))
        count += 1
      else {
        max = Math.max(max, count)
        count = 0
      }
    }
    println(max)
  }

}

