object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val ACGT = Array('A', 'C', 'G', 'T')
  val S = sc.next
  var result = 0
  var l = 0
  for (b <- S) {
    if (ACGT contains b) {
      l += 1
    } else {
      if (result < l) {
        result = l
      }
      l = 0
    }
  }
  if (result < l) {
    result = l
  }
  println(result)
}