s=gets.chomp
sz=s.size
def isACGT(s)
    a=['A','C','G','T']
    return s.split('').all?{|c|a.include?(c)}
end
ans=0
for i in 0...sz
    for j in 0...sz
        if isACGT(s[i..j])&&s[i..j].size>ans
            
            ans=s[i..j].size
        end
    end
end
puts ans
