object Main {
  val sc = new java.util.Scanner(System.in)

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

    val r = s.split("[^ACGT]").map(_.length) match {
      case x if x.isEmpty => 0
      case x => x.max
    }
    println(r)

  }
}