#include<bits/stdc++.h>
using namespace std;
int ans=-1000;
int main()
{
	string s;
	cin>>s;
	for(int i=0;i<s.size();i++)
	{
		int ans2=0;
		while(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T')
		{
			ans2++;
			i++;
		}
		ans=max(ans,ans2);
	}
	cout<<ans<<endl;
	return 0;
}