def dfs(index,prev,n,a,dp):
    if dp[index][prev] != -1:
        return dp[index][prev]

    if index==n:
        return 0

    if prev != -1 and a[prev]>=a[index]:
        return 0

    ren=max(dfs(index+1,prev,n,a,dp),dfs(index+1,index,n,a,dp)+1)
    dp[index][prev]=ren
    return ren

n=int(input())
a=[-1 for i in range(n)]

for i in range(n):
    a[i]=int(input())
max_a=max(a)+1
dp=[[-1 for i in range(n+1)] for j in range(n+1)]

sum=dfs(0,-1,n,a,dp)
if sum==0:
    print(1)
else:
    print(sum)