#include<iostream>
using namespace std; // 575
 
int main() {
	string S;
	cin >> S;
	int ans = 0;
	for (int i = 0, j = 0;i < S.size();++ i) {
		if (S[i] == 'A' || S[i] == 'T' || S[i] == 'G' || S[i] == 'C') ans = max(ans, ++j);
		else j = 0;
	}
	cout << ans;
	return 0;
}