import java.util.Scanner
fun main (args: Array<String>) {
  
  val reader = Scanner(System.`in`)
  val input = reader.next()!!.toCharArray()
  
  var count = 0
  var countList =  mutableListOf<Int>()
  
  for(c in input){
    when(c){
      'A', 'T', 'C', 'G' -> {
        count ++
      }
      else -> {
        countList.add(count)
        count = 0
      }
    }
  }
  
  countList.add(count)
  
  println(countList.max())
  
}