import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val s = sc.next()

  println(abc122b(s))
}

private fun abc122b(s: String): Int {
  var max = 0
  var tmp = 0
  for (c in s) {
    if (isACGT(c)) {
      tmp++
      max = Math.max(max, tmp)
    } else {
      tmp = 0
    }
  }

  return max
}

private fun isACGT(c: Char): Boolean {
  if (c != 'A' && c != 'C' && c != 'G' && c != 'T') {
    return false
  }
  return true
}
