input = gets.chomp
input = input.split('')

bp = ['A', 'T', 'C', 'G']
length = input.length
count = 0
max = 0

input.each_with_index do |c, i|
  if !bp.include? c
	next 
  end
  
  count += 1
  
  for j in (i+1)..(length-1)
    if !bp.include? input[j]
      break
    end
    count += 1
  end
  
  if count > max
    max = count
  end
  
  count = 0
end

puts max