function Main(input) {
	// input = input.split("\n");
	// square = input[0].split(" ");
	var val = ["A", "C", "G", "T"];
	var f = false;
	var counts = [];
	var tmp;
	for (var i = 0; i < input.length; i++) {
		if (val.indexOf(input[i]) > -1 && !f) {
			tmp = i;
			f = true;
		} else if (val.indexOf(input[i]) < 0 && f) {
			counts.push(i - tmp);
			f = false;
		}
	}
	if (f) {
		counts.push(input.length - tmp);
	}
	console.log(!counts ? Math.max.apply(null, counts) : 0);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));