#ATCoder
count = 0
ans = 0
flg = false
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
        flg = true
    else
        if ans < count
            ans = count
        end
        count = 0
        flg = false
    end
end
if flg == true && count > ans
    ans = count
end    
puts ans