module app;

import std.algorithm;
import std.array;
import std.conv;
import std.stdio;
import std.string;

void main()
{
	auto input = parseInput();
	auto result = main2(input);
    writefln("%d", result);
}

int main2(Input input)
{
    int countMax = 0;
    int count = 0;
    auto h = input.h ~ int.max;
    for (int i = 1; i < h.length; i++)
    {
        if (h[i-1] >= h[i])
        {
            count++;
        }
        else
        {
            if (countMax < count)
                countMax = count;
            count = 0;
        }
    }
    return countMax;
}

unittest
{
    Input input = {5, [10,4,8,7,3]};
    auto result = main2(input);
    assert(result == 2);
}
unittest
{
    Input input = {7, [4,4,5,6,6,5,5]};
    auto result = main2(input);
    assert(result == 3);
}
unittest
{
    Input input = {4, [1,2,3,4]};
    auto result = main2(input);
    assert(result == 0);
}

struct Input
{
	uint n;
	int[] h;
}

Input parseInput()
{
	Input input = void;
	input.n = readln().strip().to!uint;
	input.h = readln().strip().split().map!(s => s.to!int).array;
	return input;
}
