s = gets.split('').to_s

count = 0
ans = 0
tcgt = ['A','C','G','T']

(0..(s.size - 1).each do |i|

	if tcgt.include?(s[i])
		count += 1
	elsif count > ans
		ans = count
		count = 0
	end
end

if count > ans
	puts count
else
	puts ans
end