local S = io.read().."X"

local length = 0
local counter = 0

for i = 1, #S do
    local PS = string.sub(S,i,i)
    if PS == "A" or PS == "C" or PS == "G" or PS == "T" then
        counter = counter + 1
    else
        length = math.max(counter, length)
        counter = 0
    end
end

print(length)