program main
	implicit none
	character(20) :: S
	integer :: i, ans, left
	integer, allocatable :: x(:)
	read(*, *) S
	allocate(x(1:len_trim(S) + 1))
	do i = 1, len_trim(S)
		if(S(i:i) == 'A' .OR. S(i:i) == 'C' .OR. S(i:i) == 'G' .OR. S(i:i) == 'T') then
			x(i) = 1
		else
			x(i) = 0
		end if
	end do
	x(len_trim(S)+1) = 0
	
	ans = 0
	do i = 1, len_trim(S)
		if(x(i) == 1) then
			left = i
			do while(x(left+1) == 1)
				left = left + 1
			end do
			ans = max(ans, left - i + 1)
		end if
	end do
	write(*, *) ans
end program main