import java.util.Scanner

fun main(args: Array<String>) {
  val S = Scanner(System.`in`).next()
  var maxAns = 0
  var nowAns = 0
  for (c in S.toCharArray()) {
    if (c == 'A' || c == 'C' || c == 'G' || c == 'T') {
      nowAns++
      maxAns = if (maxAns > nowAns) maxAns else nowAns
    } else {
      nowAns = 0
    }
  }
  print(maxAns)
}