#include <bits/stdc++.h>
using namespace std;
int N;
int A[105];
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) cin >> A[i];
  int best = 0;
  for (int i = 0; i <= N; i++) {
    int cur = 0;
    for (int j = 0; j < i; j++) cur += A[j] == 0;
    for (int j = i; j < N; j++) cur += A[j] == 1;
    best = max(best, cur);
  }
  cout << best << "\n";
  return 0;
}
