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