from functools import lru_cache

@lru_cache(None)
def dp(n, a):
    if n == N:
        return 0
    if s[n] <= a:
        return 0
    return max(dp(n + 1, a), dp(n + 1, s[n]) + 1)

N = int(input())
s = [int(input()) + 1 for i in range(N)]
print(dp(0, 0))