var readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, terminal:false }); var str = ''; rl.on('line', function(line){ str = line.trim(); // 输出结果 console.log(maxLengthDNA(str)); str = '';
}); function maxLengthDNA(str){ var strarr = str.split(""); var arrLength = 0; var newarrLength = 0; if(str.indexOf('A')!=-1||str.indexOf('T')!=-1||str.indexOf('C')!=-1||str.indexOf('G')!=-1){ newarrLength = 1; var i = 0; for(i;i<strarr.length;i++){ var arr = []; if(strarr[i]=='A'||strarr[i]=='T'||strarr[i]=='C'||strarr[i]=='G'){ arr.push(strarr[i]); for(var j=i+1;j<strarr.length;j++){ if(strarr[j]=='A'||strarr[j]=='T'||strarr[j]=='C'||strarr[j]=='G'){ arr.push(strarr[j]); newarrLength = arr.length; i=j;
}else{ if(newarrLength<arrLength){ newarrLength = arrLength;
}else{ arrLength = newarrLength;
} break;
}
}
}
}
} return newarrLength;
}