#include <bits/stdc++.h>
using namespace std;
int n, a[110], tmp1, tmp2, maxx = 0;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  for (int i = 1; i <= n; i++) {
    tmp1 = 0;
    tmp2 = 0;
    for (int j = 1; j <= i; j++)
      if (!a[j]) tmp1++;
    for (int j = i; j <= n; j++)
      if (a[j]) tmp2++;
    maxx = max(tmp1 + tmp2, maxx);
  }
  printf("%d\n", maxx);
  return 0;
}
