import java.io.PrintWriter
import java.lang.Math.max

val pw = PrintWriter(System.out)

fun p(value: Any?) {
    pw.println(value)
}

fun solve() {
    val S = readLine()!!
    val st = "ACGT"
    var ans = 0
    for (i in S.indices) {
        for (j in S.indices) {
            if (i > j) continue
            if (S.substring(i, j+1).all { st.contains(it) }) {
                ans = max(ans, j-i+1)
            }
        }
    }
    p(ans)
}

fun main(args: Array<String>) {
    solve()
    pw.flush()
}