'use strict'

function Main(input){
	const T = input.trim();
	const answer = [];

	let start,end;
	for(let i=0,l=T.length;i<l;i++){
		//ACGTを探す
		let j;
		start = -1;
		for(j=i;j<l;j++){
			if(T[j]=='A' || T[j]=='C' || T[j]=='G' || T[j]=='T'){
				start=j;
				break;
			}
		}
		if(start === -1) break;
		for(let k=start+1;k<l;k++){
			if(T[k]!='A' && T[k]!='C' && T[k]!='G' && T[k]!='T'){
				answer.push( T.slice(start,k) );
				i=k;
				console.log(start,k);
				break;
			}
		}
	}
	console.log(Math.max( answer.map( (v)=>v.length )));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
