#include<iostream>
using namespace std;
int main()
{
    int k,ans = 0;
    int height[25]{0},dp[25];
    cin >> k;
    for(int i = 0;i < k;++i)
        cin >> height[i];
    for(int i = 0;i < k;++i){
        dp[i] = 1;
        for(int j = 0;j < i;++j){
            if(height[j] >= height[i])
                dp[i] = max(dp[j] + 1,dp[i]);
        }
        ans = max(ans,dp[i]);
    }
    cout << ans;
}