n = int(input())
A = []
dp = [0 for _  in range(n)]
dp[0] = 1
for i in range(1, n):
    num = int(input())
    A.append(num)
    dpmax = max(dp)
    for j in range(i):
        if max == dp[j]:
            if num > A[j]:
                dp[i] = dp[i-1] + 1
                break
    else:
        dp[i] = dpmax
print(dp[-1])
    