#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int a[n];
  bool judge = 0;
  int ling[100];
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] == 0) {
      cnt++;
    }
    ling[i] = cnt;
  }
  int yi[100];
  cnt = 0;
  for (int i = n; i >= 0; i--) {
    if (a[i] == 1) {
      cnt++;
    }
    yi[i] = cnt;
  }
  int maxn = 0;
  for (int i = 0; i < n; i++) {
    if (maxn < yi[i] + ling[i]) maxn = yi[i] + ling[i];
  }
  printf("%d", maxn);
}
