function main(input) {
  const S = input.split('');
  const ary = ['A', 'C', 'G', 'T'];
  let words = [];
  let word = [];
  
  for (let i = 0; i < S.length; i++) {
    if (ary.includes(S[i])) {
      word.push(S[i]);
      
      //最後のループ時に残っている文字があるのなら回収
      if (i === S.length - 1) {
        if (word.length > 0) {
          s = word.join('');
          words.push(s);
          word = [];
        }
      }
    } else {
      if (word.length > 0) {
        s = word.join('');
        words.push(s);
        word = [];
      }
    }
  }
  
  words = words.sort((a, b) => { return b.length - a.length; });
  
  if (words.length > 0) {
    console.log(words[0].length);
  } else {
    console.log(0);
  }
  
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));