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

int main() {
  string s;
  cin >> s;
  
  int ans = 0;
  int now = 0;
  for (char c : s) {
    if (c == 'A' || c == 'C' || c == 'G' || c == 'T') now++;
    else now = 0;
    ans = max(ans, now);
  }
  cout << ans << endl;
}