#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
int fx[] = {-1, 1, 0, 0, -1, -1, 1, 1};
int fy[] = {0, 0, -1, 1, -1, 1, -1, 1};
int kx[] = {1, 1, 2, 2, -1, -1, -2, -2};
int ky[] = {2, -2, 1, -1, 2, -2, 1, -1};
int n, A[102];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> A[i];
  int zero = 0, ans = 0;
  for (int i = 1; i <= n; i++) {
    if (A[i] == 0) zero++;
    int one = 0;
    for (int j = i; j <= n; j++) {
      if (A[j]) ++one;
    }
    ans = max(ans, zero + one);
  }
  cout << ans << endl;
  return 0;
}
