function Main(stdin){
stdin = stdin.trim().split("\n").reverse();
stdout = [];
function input(){return stdin.pop()};
function print(x){stdout.push(x)};


var s = input()
var n = s.length
var x = new Array(n)
var ans = 0

if (s[0]=="A" || s[0]=="T" || s[0]=="C"|| s[0]=="G"){
    x[0] = 1; ans = 1
}else{
    x[0] = 0; ans = 0
}
for (var i = 1; i < n; i++){
    if (s[i]=="A" || s[i]=="T" || s[i]=="C"|| s[i]=="G"){
        x[i] = x[i-1] + 1
    }else{
        x[i] = 0
    }
    ans = Math.max(ans, x[i])
}
print(ans)




stdout = stdout.join("\n");
console.log(stdout);
return stdout
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"))