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

int main() {
  string s;
  cin >>s;
  int ma,count;
  count =0;ma=0;
  for(int i=0;i<s.size();i++){
  	if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T'){
    count++; ma=max(count,ma);
    }
    else {count=0;}
  }
  cout <<ma;
}