import java.util.Scanner

object Main {
  def main(args: Array[String]) {
    val result = solve(new Scanner(System.in))
    if (result.length > 0) println(result)
  }

  def solve(in: String): String = solve(new Scanner(in))

  def solve(sc: Scanner): String = {
    val S = sc.next

    var max = 0
    var n = 0
    S.foreach { c =>
      if (max < n) max = n
      if ("ACGT".indexOf(c) >= 0) {
        n += 1
      } else {
        n = 0
      }
    }
    max.toString
  }
}
