program abc_b
  integer :: count=0, current_count=0
  character(10) input
  read *, input
  do i=1, 10
    select case (input(i:i))
      case ('A', 'T', 'C', 'G')
        current_count = current_count +1
      case default
        call count_up()
    end select
  end do
  call count_up()
  print '(I0)', count

  contains
    subroutine count_up()
      if (current_count > count) then
        count = current_count
        current_count = 0
      end if
    end subroutine count_up
end program
