s = gets.chomp

agct = [?A, ?G, ?C, ?T]
counter = 0
lens = [0]
s.each_char do |c|
  if agct.include?(c)
    counter += 1
  else
    lens.append(counter)
    counter = 0
  end
end
lens.append(counter)

puts lens.max()