#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 * 100 + 5;
int n, h[100], dp[100], a[200];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> h[i];
  }
  for (int j = n - 1, i = 1; i <= n; i++, j--) {
    a[i] = h[j];
  }
  dp[0] = 0;
  for (int i = 1; i <= n; i++) {
    int m = 0;
    for (int j = 0; j < i; j++) {
      if (a[j] >= a[i]) m = max(m, dp[j]);
    }
    dp[i] = 1 + m;
  }
  cout << dp[n];
}
