import java.util.*

object MainKt {
	@JvmStatic
	fun main(args: Array<String>) {
		val scanner = Scanner(System.`in`)
		val s = scanner.next()
		var ans = 0
		var l = 0
		s.toCharArray().forEach {
			if (it=='A' || it=='T' || it=='C' || it=='G') {
				l++
				ans = Math.max(ans, l)
			}else {
				l=0
			}
		}
		println(ans)
	}
}