fun main(args: Array<String>) = p3_abc122b()

fun p3_abc122b() {
    val s = readLine()!!

    val actg = listOf('A', 'C', 'T', 'G')

    var answer = 0
    var streak = 0

    for (c in s) {
        if (c in actg) streak++ else streak = 0
        answer = Math.max(answer, streak)
    }

    println(answer)
}
