#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  int a[110];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int one = 0, zero = 0;
    int locans = 1;
    for (int j = 0; j < i; j++) {
      if (a[j] == 0) locans++;
    }
    for (int j = i + 1; j < n; j++) {
      if (a[j] == 1) locans++;
    }
    ans = max(locans, ans);
  }
  cout << ans;
  return 0;
}
