#include <iostream>
 
int main (void) {
	std::string S;
	std::cin >> S;
	int cnt = 0, max = 0;
	
	for (auto c : S) {
		if (c == 'A' || c == 'C' || c == 'G' || c == 'T') {
			++cnt;
			if (max < cnt) {max = cnt;}
		} else {
			cnt = 0;
		}
	}
	
	std::cout << max;
	
	return 0;
}