object Main extends App {
  val in = scala.io.Source.stdin.getLines.toSeq
  val B = in.head
  
  val t = B.map{ e =>
    e match {
      case 'A' => '1'
      case 'T' => '1'
      case 'C' => '1'
      case 'G' => '1'
      case _ => '0'
    }
  }
  val h = t.split('0').toSeq.sorted.reverse
  val ret = if(h.isEmpty) 0 else h.head.size
  println(ret)
}
