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

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