#include <bits/stdc++.h>
using namespace std;
int n;
int a[102];
int mek[102], zro[102];
int main() {
  cin >> n;
  for (int(i) = 0; (i) < (n); ++(i)) {
    cin >> a[i];
    if (i != 0) {
      mek[i] = mek[i - 1];
      zro[i] = zro[i - 1];
    }
    if (a[i] == 0)
      ++zro[i];
    else
      ++mek[i];
  }
  int answ = mek[n - 1];
  for (int(i) = 0; (i) < (n); ++(i)) {
    answ = max(answ, zro[i] + mek[n - 1] - mek[i]);
  }
  cout << answ << endl;
  return 0;
}
