#include <bits/stdc++.h>
using namespace std;
const int N = 1e2 + 1;
int ans, n, a[N], s1[N], s2[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) s1[i] = s1[i - 1] + (a[i] == 0);
  for (int i = n; i >= 1; i--) s2[i] = s2[i + 1] + (a[i] == 1);
  for (int i = 1; i <= n; i++) ans = max(ans, s1[i] + s2[i]);
  return cout << ans, 0;
}
