#include<iostream>
using namespace std;
int main(){
  string s;
  cin>>s;
  int i,max=0,c=0;
  for(i=0;i<s.size();i++){
    if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T') c++;
    else c=0;

    if(c>max) max=c;
  }
  cout<<max<<endl;
  return 0;
}