import java.io.InputStreamReader
import java.io.BufferedReader

fun main(args: Array<String>) {
  val br = BufferedReader(InputStreamReader(System.`in`))

  val ref = "ATGC"
  val s = br.readLine().toCharArray()
  var max = 0;
  for(i in 0 until s.size) {
    if(!ref.contains(s[i]))
      continue
    
    var cnt = 0;
    for(j in i until s.size) {
      if(!ref.contains(s[j]))
        break

      max = Math.max(max, ++cnt)
    }
  }

  val ans = max
  println(ans)
}