import java.util.Scanner

import scala.annotation.tailrec

object Main {
  def main(args: Array[String]) = {
    val sc = new Scanner(System.in)
    val S = sc.nextLine()

    @tailrec
    def remain(ch: Char, str: String, subStr: String = "", ans: String = ""): String = {
      val n = ch match {
        case 'A' | 'C' | 'G' | 'T' => subStr + ch
        case _ => ""
      }
      val a = if (n.isEmpty && ans.length < subStr.length) subStr else ans
      if (str.isEmpty) ans
      else remain(str.head, str.tail, n, a)
    }
    val r = remain(S.head, S.tail)

    println(s"${r.length}")
  }
}
