str = gets.strip.chars

longest = 0

str.length.times do |i|
  len = 0
  i.upto(str.length - 1) do |j|
    if %w(A C G T).include?(str[j])
      len += 1
    else
      break
    end
  end
  longest = [longest, len].max
end

puts longest
