#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e2 + 1;
int n;
int a[maxn];
inline int solve(int start) {
  int ans = 0;
  for (int i = 0; i < start; ++i) ans += (a[i] == 0);
  for (int i = start; i < n; ++i) ans += (a[i] == 1);
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  int ans = 0;
  for (int i = 0; i <= n; ++i) ans = max(ans, solve(i));
  printf("%d\n", ans);
}
