import io.StdIn._

object Main extends App {
  val s = readLine()

  var i    = 0
  var acgt = ""
  var list = Seq.empty[String]
  do {
    if ("ACGT".contains(s(i))) {
      acgt = acgt + s(i)
    } else {
      list = list :+ acgt
      acgt = ""
    }
    i = i + 1
  } while (i < s.length)
  list = list :+ acgt
  println(list.map(_.length).max)
}
