program ATCoder
  implicit none
  character(10) :: s
  integer       :: n, y(10), i, j, m, k
  y = 0
  read(*,*) s
  s = trim(adjustl(s))
  n = len_trim(s)
  do i = 1, n
    if (s(i:i).eq."A") y(i) = 1
    if (s(i:i).eq."C") y(i) = 1
    if (s(i:i).eq."G") y(i) = 1
    if (s(i:i).eq."T") y(i) = 1
  end do
  m = 0
  do i = 1, n
    if (y(i).eq.1) then
      j = i
      k = 0
      do
        if (y(j).eq.0) exit
        k = k + 1
        j = j + 1
        if (j.gt.n) exit
      end do
      if (m.lt.k) m = k
    end if
  end do
  write(*,'(i0)') m
end program ATCoder