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

 cout<<max;
}
