#include <bits/stdc++.h>
using namespace std;
inline void up(int& x, int y) {
  x = x + y < 1000000007 ? x + y : x + y - 1000000007;
}
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int main() {
  int a, b[111], c[111], d[111], ans = 0;
  cin >> a;
  c[0] = d[0] = 0;
  for (int m = 1; m <= a; m++) {
    scanf("%d", &b[m]);
    c[m] = c[m - 1];
    d[m] = d[m - 1];
    if (b[m])
      d[m]++;
    else
      c[m]++;
  }
  for (int m = 0; m <= a; m++) ans = max(c[m] + d[a] - d[m], ans);
  cout << ans;
  return 0;
}
