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

int main(){
  string S; cin>>S;
  int a=S.size();
  vector<int> b(10,0); int c=0;
  for(int i=0;i<a;i++){
    if(S[i]=='A'||S[i]=='T'||S[i]=='G'||S[i]=='C'){
      b[c]++;
    }else{
      c++;
    }
  }
  sort(b.begin(),b.end());
  cout<<b[9]<<endl;
}