/* 状态转移方程: dp[i] = max{dp[i], dp[j] + 1} j <= i && A[j] >= A[i] 边界: dp[i] = 1 */ #include <iostream> #include <cstdio> #include <algorithm> using namespace std; const int maxn = 26; int A[maxn], dp[maxn]; int main(){ int k; scanf("%d", &k); for(int i = 0; i < k; i++){ scanf("%d", &A[i]); } int ans = 1; for(int i = 0; i < k; i++){ dp[i] = 1; for(int j = 0; j < i; j++){ if(A[j] >= A[i]){ dp[i] = max(dp[i], dp[j] + 1); } } ans = max(ans, dp[i]); } printf("%d\n", ans); return 0; }