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

/*
int findAndreturnAns(string s,int a){


  int tmp = 0;  

  for(int i = a; i < s.size(); ++i){

    if(s[i] == 'A' || s[i] == 'T' || s[i] == 'G' || s[i] == 'C'){
     tmp = i;
     break;
    }
  }
  
  int tmp2 = 0;
  
    for(int i = tmp; i < s.size(); ++i){

    if(s[i] != 'A' && s[i] != 'T' && s[i] != 'G' && s[i] != 'C'){
     tmp2 = i;
     break;
    }
  }
  
  a = tmp2;
  cout << 'a' << a << endl;
  return tmp2-tmp;

}*/

/*
int a = 0;

int findAndreturnAns(string s, int i){


  int tmp = 0;  

  for(int k = i; k < s.size(); ++k){

    if(s[k] == 'A' || s[k] == 'T' || s[k] == 'G' || s[k] == 'C'){
     tmp = k;
     break;
    }
  }
  
  int tmp2 = 0;
  
    for(int k = tmp; k < s.size(); ++k){

    if(s[k] != 'A' && s[k] != 'T' && s[k] != 'G' && s[k] != 'C'){
     tmp2 = k;
     break;
    }
  }
  
  a = tmp2;
  
  return tmp2-tmp;

}

signed main()
{
  string s; cin >> s;

 // cout << findAndreturnAns(s);
  
  vector<int> v1(s.size());
  
  
  for(int i = 0; i < s.size(); ++i){
  
     v1.emplace_back(findAndreturnAns(s,i));
cout << findAndreturnAns(s,i);
  }
 /* 
  REP(i,v1.size()){
    
   if(v1.at(i) < 0)
     v1.at(i) = v1.at(i)*(-1);
    
  }
  */
  /*
  cout << *max_element(ALL(v1));
  
  return 0;
}
  

*/







/* REPmacro */
#define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define REPR(i,n) for(int i=((int)(n)-1);i>=0;--i)
#define FOR(i,m,n) for(int i=(int)(m);i<(int)(n);++i)

/*alias*/
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define F first
#define S second
#define PB push_back
#define MP make_pair 

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev

/*using*/
using ll = long long;
using ull = unsigned long long;
using unsi = unsigned;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using db = double;
using plex = complex<double>;
using vs = vector<string>;

/*template*/
template<class T>inline bool amax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>inline bool amin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

/* func */

/*struct*/
struct aaa{
    aaa(){
        cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);
    };
}aaaaaaa;

/* const */
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7; //10^9
const db EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

//#define int ll
//#define int long long

int a = 0;

int findAndreturnAns(string s, int i){


  int tmp = 0;  

  for(int k = i; k < s.size(); ++k){

    if(s[k] == 'A' || s[k] == 'T' || s[k] == 'G' || s[k] == 'C'){
     tmp = k;
     break;
    }
  }
  
  int tmp2 = 0;
  
    for(int k = tmp; k < s.size(); ++k){

    if(s[k] != 'A' && s[k] != 'T' && s[k] != 'G' && s[k] != 'C'){
     tmp2 = k;
     break;
    }
      if(k == s.size()-1){
        tmp2 = k+1;}
      
  }
  
  a = tmp2;
 
//  cout << tmp << endl;
 
  return tmp2-tmp;

}

signed main()
{
  string s; cin >> s;

 // cout << findAndreturnAns(s);
  
  vector<int> v1(s.size());
  
  
  for(int i = 0; i < s.size(); ++i){
  
     v1.emplace_back(findAndreturnAns(s,i));
//cout << findAndreturnAns(s,i);
  }
 /* 
  REP(i,v1.size()){
    
   if(v1.at(i) < 0)
     v1.at(i) = v1.at(i)*(-1);
    
  }*/
  
  
  cout << *max_element(ALL(v1));
  
  return 0;
}


  /*  
  int a = count(ALL(s), 'A');
  int t = count(ALL(s), 'T');
  int c = count(ALL(s), 'C');
  int g = count(ALL(s), 'G');
  
  int sum = a+t+c+g;
  
  auto itr1 = s.begin();
  
  if(*itr1 == 'A' || *itr1 == 'T' || *itr1 == 'G' || *itr1 == 'C')
    --sum; 
  
  auto itr2 = s.end()-1;
  
  if(*itr2 == 'A' || *itr2 == 'T' || *itr2 == 'G' || *itr2 == 'C')
    --sum;
  
  
    cout << sum;
*/  


/*
  
  vector<int> v1(s.size());
  
  
  for(int i = 0; i < s.size(); ++i){
  
     v1.emplace_back(findAndreturnAns(s,a));
cout << 'f' << findAndreturnAns(s,a);
  }

  
  cout << *max_element(ALL(v1));
  */
/*

  int tmp = 0;  

  for(int i = 0; i < s.size(); ++i){

    if(s[i] == 'A' || s[i] == 'T' || s[i] == 'G' || s[i] == 'C'){
     tmp = i;
     break;
    }
  }
  
  int tmp2 = 0;
  
    for(int i = tmp; i < s.size(); ++i){

    if(s[i] != 'A' && s[i] != 'T' && s[i] != 'G' && s[i] != 'C'){
     tmp2 = i;
     break;
    }
  }
  
  
  
      cout << tmp2-tmp;
 */

Measured memory_bytes: 256