#include <bits/stdc++.h>
using namespace std;
int rlt[2][100];
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  rlt[a[0]][0] = 1;
  for (int i = 1; i < n; i++) {
    if (a[i]) {
      rlt[1][i] = max(rlt[0][i - 1], rlt[1][i - 1]) + 1;
      rlt[0][i] = rlt[0][i - 1];
    } else {
      rlt[0][i] = rlt[0][i - 1] + 1;
      rlt[1][i] = rlt[1][i - 1];
    }
  }
  cout << max(rlt[0][n - 1], rlt[1][n - 1]);
  return 0;
}
