// B - ATCoder
#include <bits/stdc++.h>
using namespace std;

int main(){
	string T="ACGT", S; cin>>S;
	int maxi = 0;
	for(int now=0, i=0; i<S.size(); ++i)
		maxi = max(maxi, now = T.find(S[i]) < T.size()? now+1: 0);
	cout<< maxi <<endl;
}