s = gets.strip
result = []
tmp = ''
s.each_char do |char|
  if ['A', 'C', 'G', 'T'].include?(char)
    tmp += char
    result << tmp
  else
    tmp = ''
  end
end
puts result.size == 0 ? 0 : result.map(&:length).max