import std.stdio;
import std.algorithm;
import std.conv;
import std.datetime;
import std.numeric;
import std.math;
import std.string;

string my_readln() { return chomp(readln()); }

void main()
{//try{
	auto tokens = split(my_readln());
	auto N = to!ulong(tokens[0]);

	ulong last, ans = 1, reserve;

	foreach (i, token; split(my_readln()))
	{
		auto a = to!ulong(token);
		if (i != 0)
		{
			if (a <= last)
			{
				if (reserve == 0)
				{
					++ans;
					++reserve;
				}
				else
				{
					--reserve;
				}
			
			}
		}
		last = a;
	}

	writeln(ans);
	stdout.flush();
/*}catch (Throwable e)
	{
		writeln(e.toString());
	}
readln();*/
}