n = int(input())
parent = [[i, 1] for i in range(n)]
def root(x):
	if parent[x][0] == x:
		return x
	parent[x][0] = y = root(parent[x][0])
	return y
def union(x, y):
	px = root(x)
	py = root(y)
	if px == py:
		return
	if px > py:
		px = root(y)
		py = root(x)
	parent[y] = [px, parent[x][1]+1]
	return

Q = []
for i in range(n):
	a = int(input())
	for j in range(i):
		if Q[-j-1] < a:
			union(i-j-1, i)
			continue
	Q += [a]
print(max(map(lambda x: x[1], parent)))
