import java.util.*

fun main(args: Array<String>) {
    val s = Scanner(System.`in`).next()

    val atcg = listOf('A', 'T', 'C', 'G')
    var max = 0
    var cur = 0
    s.forEach { c ->
        if (atcg.contains(c)) {
            cur++
        } else {
            cur = 0
        }
        max = Math.max(max, cur)
    }

    println(max)
}