program answer
  implicit none
  integer :: N, i, j, count, a, b
  integer, allocatable :: H(:), s(:), d(:)
  read(*,*) N
  allocate(H(N))
  read(*,*) H
  allocate(s(N))
 
 s(:)=0 
  count=0
  do i = 1, n-1
     if(H(i)<H(i+1)) then
        count=count+1
        s(count)=i
     end if
  end do

  if(count==1) then
     write(*,*) max(s(1)-1, n-s(1)-1)
     stop
  else if(count==n-1) then
     write(*,*) 0
     stop
  else if(count==0) then
     write(*,*) n-1
     stop
  end if
  allocate(d(count-1))
  do i = 1, count-1
     d(i)=s(i+1)-s(i)-1
  end do
  
  
  write(*,*) max(maxval(d), s(1)-1, n-s(count)-1)

  deallocate(d)
  deallocate(s)
  deallocate(H)
  stop
 end program answer
        
