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