input_string = gets.chomp.split("").map(&:to_s)
list=["A","C","G","T"]
tmp_string=[]
parts_string=[]

input_string.each{|char|
    if list.include?(char)
        tmp_string << char
        parts_string=tmp_string if tmp_string.length > parts_string.length 
    else
        tmp_string=[]
    end
}

puts parts_string.length