program main
  implicit none
  character(len=10) :: S
  integer :: N
  character(:),allocatable :: stmp
  integer :: out
  integer :: i, j, k
  logical :: OK
  read(*,*) S
  N = len_trim(S)
  out = 0
  do i = 1, N
     do j = i,N
        stmp = S(i:j)
        OK = .true.
        !write(*,*) stmp
        do k = 1,len(stmp)
           if ( stmp(k:k) =='A' .or. &
                stmp(k:k) =='C' .or. &
                stmp(k:k) =='G' .or. &
                stmp(k:k) =='T'                 ) then
              cycle
           else
              OK = .false.
           end if
        end do
        if ( OK ) then
           if ( out < len(stmp)) then
              out = len(stmp)
           end if
        end if
        deallocate(stmp)
     end do
  end do
  write(*,'(i0)') out
  stop
end program main
