s = STDIN.readline.strip

atcg = ['A', 'T', 'C', 'G']
len = 0
maxlen = 0
s.chars do |c|
  if atcg.include? c
    len += 1
  else
    if len > 0 && maxlen < len
      maxlen = len
    end
    len = 0
  end
end

if len > 0 && maxlen < len
  maxlen = len
end

puts maxlen