s = gets.chomp.to_s.split(//)
count = 0
max_count = 0

s.each do |r|
    if r == "A" || r == "G" || r == "C" || r == "T"
        count += 1
        if count > max_count
            max_count = count
        end
    else
        count = 0
    end
end

puts max_count