n = int(input())
num = list(map(int, input().split(" ")))
dp = [1 for i in range(n)]  # 初始为1
for i in range(n):
    for j in range(i):
        if num[j] >= num[i]:
            dp[i] = max(dp[i], dp[j] + 1)
ans = 1
for i in range(n):
    if dp[i] > ans:
        ans = dp[i]
print(ans)