s = gets.strip.to_s
acgt = ['A', 'C', 'G', 'T']
str = ''
max_length = 0
s.chars do |c|
  str << c if acgt.include?(c)
  unless acgt.include?(c)
    max_length = str.length if max_length < str.length
    str = ''
  end
end
puts max_length
