object Main {
  def main(args: Array[String]): Unit = {
    val s = io.StdIn.readLine()
    val splitted = s.split("[^ACGT]").map(_.length)

    val max = if (splitted.isEmpty) 0 else splitted.max

    println(max)
  }
}
