function Main(input) {
  var helix = {
    "A": "T",
    "T": "A",
    "C": "G",
    "G": "C"
  };
  var count = 0;
  var maxCount = 0;
  for ( var i = 0; i < 10; i++) {
    if(helix[input[i]]) {
      count++;
    } else {
      if ( maxCount <= count){
        maxCount = count;
      }
      count = 0;
    }
  }
  if(maxCount <= count) {
    maxCount = count;
  }
  console.log(maxCount);
}

process.stdin.setEncoding('utf-8');
process.stdin.on('data', function(data){
  Main(data.trim());
});
