#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, res;
  int A[113], D[113];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  for (int i = 0; i < n; i++) {
    D[i] = 1;
    for (int j = 0; j < i; j++) {
      if (A[j] <= A[i]) {
        D[i] = max(D[i], 1 + D[j]);
      }
    }
  }
  res = D[0];
  for (int i = 1; i < n; i++) {
    if (D[i] > res) {
      res = D[i];
    }
  }
  cout << res;
  return 0;
}
