object Main extends App {
    val s = readLine

    val answer = (for (i <- 0 until s.length; j <- 0 until s.length if i < j) yield {
        val sub = s.slice(i, j)
        if(sub.matches("[ATGC]*")) sub.length else 0
    }).max

    println(answer)
}