#include <stdio.h>
int main(){
	char a[11]={0,0,0,0,0, 0,0,0,0,0,0};
	scanf("%s",a);

	int c,a1=0,a2=0;
	for(c=0;c<11;c++){
		if(a[c]=='A'||a[c]=='T'||a[c]=='G'||a[c]=='C')a1++;
		else if(a2<a1) a2=a1,a1=0;
		else a1=0;
	}
	printf("%d\n",a2);

	return 0;
}