program main
implicit none
character(len=10) :: c, s
integer :: nlen, nsum, nslen
integer :: i, j, k,m
integer, allocatable :: nc(:,:)
read(*,*) c
nlen = len_trim(c)
!nsum = nlen*(nlen+1)/2
allocate(nc(nlen,nlen))

do i = 1, nlen
   do j = i, nlen
      s = c(i:j)
     nslen=len_trim(s)
      nc(i,j) = 0
      do k = 1, nslen
         if ( s(k:k) == 'A'.or.s(k:k) == 'T'.or.s(k:k) == 'C'.or.s(k:k) == 'G') then
            nc(i,j) = nc(i,j)+1
         else 
            nc(i,j) = 0
         end if
      end do
   end do
end do

m = 0
do i = 1, nlen
do j = i, nlen
    if( nc(i,j) >= m) then
       m = nc(i,j)
    end if
end do
end do

write(*,'(i0)') m

end program main
