s = gets.chomp.split('')

r = 0
n = 0
s.each do |c|
  if "ATCG".include?(c)
    if n == 0
      n = 1
    else
      n += 1
    end
  else
    if n != 0
      if r < n
        r = n
      end
      n = 0
    end
  end
end

puts r

