function Main(input){
  S = input.trim().split('');
  count = 0;
  max_count = 0;
  S.forEach((ch)=>{
    if(ch === 'A' || ch === 'T' || ch === 'G' || ch === 'C'){
      count++;
    }else{
      max_count = count > max_count ? count : max_count;
      count = 0;
    }
  });
  console.log(count > max_count ? count : max_count);
}

Main(require("fs").readFileSync("/dev/stdin","utf-8"));
