#include <bits/stdc++.h>
using namespace std;
int n, x[105], ans, f[105];
bool ok(int a, int b) {
  if (x[a] == 1 && x[b] == 0) return false;
  return true;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> x[i], f[i] = 1;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < i; ++j) {
      if (ok(j, i)) f[i] = max(f[j] + 1, f[i]);
    }
    ans = max(ans, f[i]);
  }
  cout << ans << endl;
  return 0;
}
