program prob2
    implicit none
    integer::N, i, ans, tmp
    integer, allocatable::h(:)
    read(*,*) N
    allocate(h(N))
    read(*,*) h
    ans = 0
    tmp = 0
    do i = 2, N
        if(h(i) <= h(i-1)) then
            tmp = tmp + 1
        else
            ans = max(ans, tmp)
            tmp = 0
        end if
    end do
    write(*,*) max(ans,tmp)
    stop
end program