object Main extends App {
    val s = io.StdIn.readLine
    val n = s.length

    def isACGT(char: Char): Char = char match {
        case 'A' | 'C' | 'G' | 'T' => char
        case _ => 'x'
    }

    val buf = new StringBuilder
    for (count <- 0 until n) {
        val char = s(count)
        if (count != 0) {
            if (!(isACGT(char) == 'x' && buf.last == 'x')) buf += isACGT(char)
        } else {
            buf += isACGT(char)
        }
        
    } 
    val formatted = buf.toString

    if (formatted == "x") println(0)
    else {
        val array = formatted.split("x")
        val answer = array.map(_.length).max
        println(answer)
    }
}