local s=io.read()
local t={"A","G","C","T"}
local max=0
local len=0
for i=1,#s do
    local check=false
    for j=1,4 do
        if s:sub(i,i)==t[j] then
            check=true
        end
    end
    if check then
        len=len+1
    else
        len=0
    end
    max=math.max(max,len)
end
print(max)