fun main(args: Array<String>) {
    abc122b()
}

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

    val s = readLine()!!.toCharArray().toList()

    var maxLengthString = 0
    for (i in s.indices) {
        for (j in i + 1 .. s.size) {
            val subList = s.subList(i, j)
            if (actg.containsAll(subList)) {
                if (subList.size > maxLengthString) maxLengthString = subList.size
            }
        }
    }

    println(maxLengthString)
}
