program main
  implicit none
  character(len=10) :: S
  integer :: n
  integer,allocatable :: A(:)
  integer :: om
  integer :: out
  integer :: i
  read(*,*) S
  n=len(trim(S))
  allocate(A(N))
  A=0
  do i = 1,N
     if (S(i:i)=='A') then
        A(i) = 1
     elseif (S(i:i)=='T') then
        A(i) = 1
     elseif (S(i:i)=='C') then
       A(i) = 1 
     elseif (S(i:i)=='G') then
       A(i) = 1 
     end if
  end do

  out=0
  om=0
  do i = 1,N
     if (A(i) == 1) then
        out=out+1
     else
        if (out > om) om=out
        out=0
     end if
  end do
  write(*,'(i0)') om
  stop
end program main
