fun main(args: Array<String>) {
    val s = readLine() ?: return
    val match = mapOf('A' to 1, 'C' to 1, 'G' to 1, 'T' to 1)
    var longest = 0
    var counter = 0
    s.forEach {
        if (match.containsKey(it)) {
            counter++
        } else {
            longest = Math.max(counter, longest)
            counter = 0
        }
    }
    longest = Math.max(counter, longest)
    println(longest.toString())
}