#include <iostream>
#include <vector>
using namespace std;

char S;
vector<int> memo;
int temp = 0,ans = 0;

int main() {
  while(cin>> S) {
    if(S == 'A' || S=='C'||S=='G'||S=='T') {
	  temp++;
	}else{
	  ans = max(temp,ans);
	  temp = 0;
	}
  }
  ans = max(temp,ans);
  cout << ans << endl;
}
