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