#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long int a[100000];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int result[100001] = {};
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i - 1; j >= 0; j--) {
      if (a[j] < a[i]) {
        result[i] = result[j];
        break;
      }
    }
    result[i]++;
    ans = max(ans, result[i]);
  }
  cout << ans << endl;
  return 0;
}
