import java.util.Scanner

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


    val bl = s.split("(?<=.)").map{"ATGC".contains(_)}
    val res =
      bl.foldLeft(List.empty[Int]){ case (l, b) =>
        if( l.isEmpty) if(b) List(1) else List(0)
        else if(b) l :+ (l.last + 1) else l :+ 0
      }
    println(res.max)
  }
}