s= gets.chomp
acgt = ['A','C','G','T']
count = 0
max_num = []
s.length.times do |a|
    if s.length>1
        if acgt.include?(s[a])
            count += 1
            max_num.push(count)
        else
            max_num.push(count)
            count = 0
        end
end
puts max_num.max
