#include <iostream>
#include <algorithm>
using namespace std;

int main() {
	string S;
	cin >> S;
	int MAX = 0, now=0;
	for (char c : S) {
		if (c == 'A' || c == 'C' || c == 'G' || c == 'T') {
			now++;
			MAX = max(MAX, now);
		}
		else now = 0;
	}
	cout << MAX << endl;
}