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