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