#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int k;
while (cin >> k) {
vector<int> height(k);
for (int i = 0; i < k; i++) cin >> height[i];
vector<int> sum(k, 1);
for (int i = k - 2; i >= 0; i--) {
for (int j = i + 1; j < k; j++) {
if (height[i] >= height[j]) {
sum[i] = max(sum[i], sum[j] + 1);
}
}
}
sort(sum.begin(), sum.end());
cout << sum[k - 1] << "\n";
}
return 0;
}

京公网安备 11010502036488号