#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int n;
int a[200000];
int ans[200000];

int solve(int idx) {
    if (ans[idx] != 0) return ans[idx];

    int ans1 = 0;
    for (int i = idx-1; i >= 0; i--) {
        if (a[i] >= a[idx]) break;
        ans1 = max(ans1, solve(i));
    }

    int ans2 = 0;
    for (int i = idx+1; i < n; i++) {
        if (a[i] >= a[idx]) break;
        ans2 = max(ans2, solve(i));
    }

    return ans[idx] = max(ans1, ans2)+1;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];

    int ans = 0;
    for (int i = 0; i < n; i++) ans = max(ans, solve(i));

    cout << ans << endl;

    return 0;
}
