function Main(input) {
    var longest = 0;
    var current = 0;
    for(var i = 0; i < input.length; i++) {
        if(input[i] == "A" || 
        input[i] == "T" || 
        input[i] == "C" || 
        input[i] == "G"){
            current++;
            continue;
        }
        if(current > longest) longest = current;
        current = 0;
    }
    if(current > longest) longest = current;
    console.log(longest);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
