S = gets.chomp().split("")

acgt = ["A", "C", "G", "T"]

count = 0
max_count = 0

S.each do |s|
  if acgt.include?(s)
    count += 1
  elsif count > max_count
    max_count = count
    count = 0
  else
    count = 0
  end
end

puts [max_count, count].max