object Main extends App {
    var get = readLine
    var i = 0
    var j = 0
    var max = 0
    var sum = 0
    var loop = 0
  
  for(i <- 0 to get.size - 1) {
    	j=i
      while(loop==0){
        if(get.charAt(j)=='A')
          sum+=1
    	else if(get.charAt(j)=='C')
          sum+=1
    	else if(get.charAt(j)=='G')
          sum+=1
    	else if(get.charAt(j)=='T')
          sum+=1
        else
    		loop=1
        j +=1
      }
        max = math.max(sum,max)
        sum = 0
        loop = 0
  }
  println(max)
}