import scala.annotation.tailrec

object Main extends App {
  val sc = new java.util.Scanner(System.in) 
  sc.useDelimiter("\n")
  val s = sc.next().toList
  val t = Seq('A', 'C', 'G', 'T')
  var max = 0
  println(calc(0, 0, 0))

  @tailrec
  def calc(index: Int, max: Int, part: Int): Int = {
    if (index == s.length) {
      max
    } else if (t.contains(s(index))) {
      if (max < part + 1) {
        calc(index+1, part+1, part+1)
      } else {
        calc(index+1, max, part+1)
      }
    } else {
      calc(index+1, max, 0)
    }
  }
}