fun main(args:Array<String>?): Unit {
    val acgt = "ACGT"
    val s = readLine()!!.trim()
    println(
            (1 .. s.length).reversed().find{length -> (0 .. s.length - length).any{from -> (from until from + length).all{s[it] in acgt}}} ?: 0
    )
}