import scala.io.StdIn

object Main extends App {
  val longest = StdIn.readLine().split("[^ACGT]").reduceLeftOption[String] { case (longest, string) =>
    if (longest.length < string.length) string else longest
  }

  println(longest.map(_.length).getOrElse(0))
}
