fun main(arr:Array<String>) {
    val s = "Z" + readLine()!! + "Z"
    var start = 0
    var ans = 0
    for(i in s.indices) {
        if("ACGT".contains(s[i])) {
            continue
        }
        ans = Math.max(ans, i - start)
        start = i + 1
    }
    println(ans)
}