object Main{
  def main(args: Array[String]): Unit = {
    val input = io.StdIn.readLine.toStream.toList
    val indices = (List(0) ++ input.zipWithIndex.filterNot(item => Set("A", "C", "G", "T").contains(item._1.toString)).map(_._2) ++ List(input.length - 1)).toVector
    println((indices.slice(0, indices.length) zip indices.slice(1, indices.length+1) map (x  => x._2 - x._1)).max)

  }
}