#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
int val[maxn];
int dp[maxn];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &val[i]);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int max_len = 0;
    for (int j = i - 1; j >= 1; j--) {
      if (val[i] >= val[j]) {
        max_len = max(max_len, dp[j]);
      }
    }
    dp[i] = max_len + 1;
    ans = max(ans, dp[i]);
  }
  printf("%d\n", ans);
}
