s = gets.strip.split("")
ary = ["A", "C", "G", "T"]
count = 0
max = []
s.each do |i|
  if ary.include?(i)
    count += 1
    max.push(count)
  else
    max.push(count)
    count = 0
  end
end
puts max.max