s = gets.chomp.chars
ans = 0
(0..s.size-1).each do |i|
  (i..s.size-1).each do |j|
    size = s[i..j].size if s[i..j].all? { |k| ['A', 'G', 'C', 'T'].include?(k) }
    size = 0 if size.nil?
    ans = size if size > ans
  end
end
p ans
