object Main extends App {
  val line1 = io.StdIn.readLine

  var flag = false
  var cnt = 0
  var max = Int.MinValue

  for (c <- line1) {
    c match {
      case 'A' | 'C' | 'G' | 'T' => {
        flag = true
        cnt += 1
      }
      case _ if flag => {
        max = if (cnt > max) cnt else max
        flag = false
        cnt = 0
      }
      case _ =>
    }
  }
  max = if (cnt > max) cnt else max
  println(max)
}
