"use strict";
const input = require("fs").readFileSync("/dev/stdin", "utf8");
let ans = 0;
const jadgeArr = new Array(input.length);
let temp = 0;

// 一度配列に変換
for(let i = 0; i < input.length; i++){
  	// 該当文字なら1を入れる、それ以外なら0
	if(input.charAt(i) == "A" || input.charAt(i) == "C" || input.charAt(i) == "G" || input.charAt(i) == "T" ){
      jadgeArr[i] = 1;
    }else {
      jadgeArr[i] = 0;
    }
}

// そのあとに最長を調べる
jadgeArr.forEach(
	x => {
    	if(x == 1){
        	temp++;
        }else {
        	if(temp >= ans){
            	ans = temp;
            }
          	temp = 0;
        }
    }
)

console.log(ans)