fun main(args: Array<String>) {
    val S = readLine()!!.toCharArray()
    var ans = -1000000
    var l = -1
    for (r in S.indices) {
        if ("ACGT".contains(S[r])) continue
        ans = Math.max(ans, r - l - 1)
        l = r
    }
    ans = Math.max(ans, S.size - l - 1)
    println(ans)
}