#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
const long long mod = 1e9 + 7;
const long long MOD = 998244353;
using namespace std;
signed main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    long long x = 1;
    for (long long j = 0; j < i; j++) {
      if (a[j] == 0) x++;
    }
    for (long long k = i + 1; k < n; k++) {
      if (a[k] == 1) {
        x++;
      }
    }
    ans = max(ans, x);
  }
  cout << ans << "\n";
  return 0;
}
