require 'set'

ok_set = Set.new %w(A T C G)

STDIN.each do |line|
  line.chomp!
  max_len = 0
  cnt = 0
  line.each_char do |ch|
    if ok_set.member?(ch)
      cnt += 1
      max_len = cnt if cnt > max_len
    else
      cnt = 0
    end
  end
  STDOUT.puts max_len
end