import java.io.InputStreamReader
import java.io.BufferedReader

fun main(args: Array<String>) {
  val br = BufferedReader(InputStreamReader(System.`in`))

  val ref = "ATGC"
  val s = br.readLine().toCharArray()

  val ans = s.fold(Pair(0, 0)) { acc , si ->
    val (max, cnt) = acc
    if(ref.contains(si)) Pair(Math.max(max, cnt+1), cnt+1) else Pair(max, 0)
  }.first

  println(ans)
}