#include <bits/stdc++.h>
using namespace std;
int N, ans, psum[101], a;
int main() {
  cin >> N;
  for (int i = 1; i <= N; i++) {
    cin >> a;
    psum[i] = psum[i - 1] + a;
  }
  for (int i = 0; i <= N; i++) {
    ans = max(ans, N - (((N - i) - (psum[N] - psum[i])) + psum[i]));
  }
  cout << ans << "\n";
}
