object Main extends App {
  import scala.io.StdIn._

  val tg   = "ATCG"
  val line = readLine()

  val result =
    line
      .foldLeft((0, 0)) {
        case ((maxCount, count), c) =>
          if (tg.contains(c)) (Math.max(maxCount, count + 1), count + 1)
          else (maxCount, 0)
      }
      ._1

  println(result)
}
