#ATCoder
count = 0
ans = 0
S = gets.chomp.to_s
for i in 0..S.length-1 do
    if S[i] == "A"|| S[i] == "C" || S[i] =="G" || S[i] =="T"
        count = count + 1
    else
        if ans < count
            ans = count
        end
        count = 0
    end
end
puts ans