program ATc
  implicit none
  character(len=10) :: S
  integer :: i,j,Maxk,N
  integer,allocatable :: Flags(:)
  character :: si
  read(*,*) S
  N=len_trim(S)
  allocate(Flags(N))
  Flags=0
  do i=1,N
     si=S(i:i)
!     write(*,*) si                                                                                                                                         
     if((si.eq.'A').or.(si.eq.'T')) then
        Flags(i)=1
!        write(*,*) 'arude'                                                                                                                                 
     elseif((si.eq.'C').or.(si.eq.'G')) then
        Flags(i)=1
     endif
  enddo
  Maxk=0
  j=0
 ! write(*,*) N,Flags                                                                                                                                       
  do i=1,N
     if(Flags(i).eq.1) then
        j=j+1
     else
        j=0
     endif
     if(j.gt.Maxk) then
        Maxk=j
     endif
  enddo
  write(*,'(i0)') Maxk

  deallocate(Flags)
end program ATc
