program main
  implicit none
  integer(8) i,HS,CS,N
  integer(8),allocatable :: H(:)
  read(*, *) N
  allocate(H(N))
  read(*, *) (H(i), i = 1,N)
  HS = 0
  CS = 0
  if (N == 1) then
    HS = 0
  else
    do i =1,N-2
      if (H(i) >= H(i+1)) then
        CS = CS + 1
      else
        if (CS > HS) then
          HS = CS
        end if
        CS = 0
      endif
    end do
    if (H(N-1) >= H(N)) then
      CS = CS + 1
      if (CS > HS) then
        HS = CS
      end if
    else
      if (CS > HS) then
        HS = CS
      end if
    endif
  end if

  write(*, *) HS
end program main
